> On a higher level, some potential buyer will look at the companies financial statements, and figure out if the share price is too high / low for how the company is performing, from a financial standpoint. This is called "fundamental analysis", and you can easily find step-by-step analysis reports of such on various companies.
How does this work if a company doesn't pay out dividends? There's no investment to return unless someone buys from you at the same or higher price... right?