Furthermore, a lot of business models require convincing other people to support you, either through investment, or through getting a larger share of your company's budget. This filters out many incompetent businesses, but since open source is free, the filter is poorer It's like asking why the average book in a bookstore is better than the average book on Amazon Kindle--if you don't need to convince a publisher to spend their limited resources on your book, there's one less filter for bad books.
The least unreasonable for-profit open-source companies (e.g., Red Hat) use the labor of skilled developers as the unique value, i.e., anyone can run Red Hat just fine but if you want the world's most qualified people to work on your specific problems you have to pay them. But even this produces a vague incentive not to write public documentation and not to write understandable and easy-to-maintain products.
The other way to do things (e.g., Google, Facebook) is to have some business entirely unrelated to the value of your open source and open-source infrastructure things (e.g., Go and React) that make your business better if they're open-source but don't meaningfully make it easier to compete with you.
Then there are the companies that realized they didn't actually want to contribute their core product to a commons (e.g., Elastic) or companies that couldn't meaningfully monetize their open-source core product (e.g., Sun, Netscape).