You're talking about MVRV (Market Value to Realized Value). If it's below 1, it means the average investor is carrying a loss, and > 1 means carrying profit. Historically every halving it has spent some time below 1, and we are right on schedule.
The money builds a new factory. Or in the case of Google, a data center, or other such item that allows the company to make more money.
Later, when the company is worth more, the shareholder sells the stock back and/or gets a dividend (aka, a slice of the profits).
Everyone wins.
--------
In contrast, the BTC you bought was likely made using stolen electricity. So we're already negative sum to the start.