If you're interested in thinking more about it, Peter Thiel's Zero to One is a very interesting book. It's certainly not necessarily true that a monopoly ends up providing value like that, but with Google as an example, it's very unlikely they would provide so much open source code if they were in a vicious fight for survival.
> [T]he history of progress is a history of better monopoly businesses replacing incumbents. Monopolies drive progress because the promise of years or even decades of monopoly profits provides a powerful incentive to innovate. Then monopolies can keep innovating because profits enable them to make the long-term plans and finance the ambitious research projects that firms locked in competition can't dream of.
https://www.wsj.com/articles/peter-thiel-competition-is-for-...