Factually stocks just are like bets, you bet on it to go up, but it can go down. if you own stocks in swiss cheese, then someone complains it has a hole too many, stocks go down an you lose money
supply and demand, and utility
utility is, the wish to buy something versus the compatibility of the price
so my utility in swiss cheese would be ideally at the cutting line of optimal supply and minimum price
of course it might get a bit harder than that, but that is basically what the stocks do
gamble on rising or falling prices
same happens for money btw
a countries currency goes to the stock market on the highest levels
potentially, the stock market can destroy a countries financial power in one go with a bit of bad luck
that and the printing press (dollar being printed more= worth less)