There is only so much real money in the world, and that is determined by the Treasuries and Feds of the world. There are only so many dollars that were ever created, so many Japanese yen that were ever created, and so many Turkish lira that were ever created.

The stock market is a wealth redistribution mechanism, not a money printer. Market caps going up are not equal to money being created. It's not like the shareholders could collectively cash out all of that market cap and spend it. If everyone sold all of their stocks and pulled fully out of the stock market until everything crashed to $0, everyone's cash would still sum to whatever the government printed.

Although the stock market isn´t in itself, it benefits from the second order effects of continuous money supply expansion, and long term processes progressively concentrating money into the financial system.