That's not true, shares are a share of the companies assets and future dividends.
There are "scavengers" out there who buy a company if its assets are worth more than the market cap, close down the company or otherwise spin out the assets, and thus earn more than they paid for the shares.