Sir this is just a casino. Stocks have nothing to do with the businesses right after they are issued. A business can opt to just never issue dividends (Hi Amazon). So the stock itself has 0 actual value. It does not generate cash. (Ok if the company goes belly up you will get a percentage of the carcass)
But we can all gamble on what it is worth!
So stockholders are like roulette pill holders. Everyone just bets on where the pill will fall. Few are luckier than others. Some smarter know whether the roullete is rigged and have better chances.
It's a Keynesian Beauty Contest:
> A Keynesian beauty contest is a metaphorical beauty contest in which judges are rewarded for selecting the most popular faces among all judges, rather than those they may personally find the most attractive.
This explains why informed investors know TSLA is worthless, but they also know that the retail market as a whole thinks it's as precious as unicorn tears, so it is priced accordingly.
A company could decide to never pay a dividend, yes. But that doesn't mean the stock is worthless; you need to take the thought process further. Who ultimately controls a company? The shareholders. So, imagine a scenario where a company is profitable and seemingly valuable, but for some reason the share price is not increasing, so the shareholders are not seeing their wealth increase. In that scenario they would probably either pay a dividend or, more likely, take advantage of the profitability and low stock price to buy back stock, driving up its value.
Either way, the owners of a successful company are going to want to profit from it, which will make the shares valuable. Of course, investors know this, and so the share price tends to track current value of expected future earnings even without the company taking direct action to distribute profits.