And yes it's easier to build a better company on a better product.
But history is littered with "worse products" that won in the marketplace.
It turns out that all the attributes you name are helpful but not necessary. Good marketing trumps good product. We see this over and over again.
The best combination is good marketing and good product. If I can only get 1 of those then I'll take hood marketing. Equally if you have a good product but bad marketing you don't get many (if any) users. The "ask" section on this site is littered with that.
So, assuming we can all make "good enough" code, the code doesn't matter. It's all good enough. The distinguishing feature is the marketing, because that leads to market share, and that's all any company is really selling (once it sells for a lot).
I'm upvoting you because your comment is well made, and certainly common, even if it is incorrect:)
Having been involved in multiple different acquisitions, on both sides of the table, I can anecdote that the code quality had no impact on any part of the acquisitions. The players are not buying or selling the code.