What would you pay for one of those shares? Nothing, right? The company is worthless.
Now imagine that same company has a bank balance of $100. Each share now also owns a 1% share of the bank balance (because it owns 1% of the company itself). How much would you pay for such a share? Anything below a dollar seems pretty good to me!
In other words, the more valuable assets the company holds, the more we'd be willing to pay for shares of the company, all else equal. This is called the 'book value' of a company and is total assets - intangible assets (patents, goodwill) and liabilities.
Note that the real-life situation is slightly more complex because you can't always get at the assets, even if you buy the shares for cents on the dollar. But the general idea is that you can buy shares until you have enough voting rights to dole out the cash as dividends.