What really happens is these founders are focused on the product and don't really think much about the business model. This is understandable and actually much better than MBA types who spend months planning for stuff without even building, but the problem is there isn't really a good business model for these types of companies.
The only viable option is ads, and even this has been monopolized by big techcos so it's not easy.
Most founders don't even get to worrying about this point because their companies never take off. But the ones that do, come to a point where they need to make a decision whether to sell out or to find a viable business model.
Like I said, finding a viable business model is increasingly becoming difficult for consumer apps that rely on ads, so these companies tend to cash out.
From outside it may look like a bunch of "tech bros" hoping to strike it big with minimal effort but that's mostly not the case if you look inside. If you're curious, look up what this TBH company went through before having this "overnight success".