What do you think happens with the money that goes into stock? It doesn't simply vanish. It ultimately gets invested in salaries, construction of data centers and factories.
That's most certainly not what happens! The money that goes into buying a stock is being transferred to the people who sold you the stock (which, outside of the IPO are almost always market players).
A company with a high stock price can "save money" by paying employees in stock, borrowing money cheaper, but it's NOT a primary way of funding the company.
And where does the money of the seller go? Back into other stock or (less likely) consumption. Eventually it goes towards newly issues stock or gets invested in early stage companies that put all of it towards direct investments into people or productivity assets.
A company with a high stock price can "save money" by paying employees in stock, borrowing money cheaper, but it's NOT a primary way of funding the company.