Buying shares means you own some of that; that is the value.
These companies likely pay their employees, and as a shareholder you get to partake and harvest value, without having to work for it.
If the company earns more than last year, the stock should be worth more. But of course, valuation clouds the picture, where dividends are usually simpler to model.