That’s not how it works at all. You can build wealth very effectively through stocks even if the company doesn’t grow one bit. Conversely, you can lose wealth by owning high-growth, competitive companies if the purchase price is too high.
What is priced into the stock price is the most essential variable, regardless of what you own.