The problem with the stock market is that you gamble on speculations. And you do so without any connection to the balance sheet of the company. Most of the shareholders are not the original shareholders, that means that they never invested a single penny to the company. They only paid speculators. And these speculators paid others etc.
Stock market is mostly* a glorified pump and dump scheme that looks for the greatest fool[1].
[1] https://en.wikipedia.org/wiki/Greater_fool_theory
*exluding the IPOs and issuing of new shares where actual money flows from the investors to the balance sheets of companies.