The stock market is real, you are investing in a company when you buy, you have equity. If it pays dividend, you are entitled to your portion of it. I can sell all my stock and it won't move the market a blip. On the other hand, if you day trade then it's gambling. Well informed gambling ,but short term movements are not really predictable, hence a gamble. If you trade options, it's either gambling or part of a hedge strategy, which is legit.
If Zuckerberg sells all his stock in Meta it would create panic selling and the shares would collapse and a company that's stock is worthless doesn't fare well or remain alive for long. That's the difference.