If the company does well, or even if everyone thinks the company is going to do well, the price of the stock goes up. This is how stockholders make a return on their investment. Conversely, if the company does poorly, then the shares decrease in value, and the stockholders lose their investment.
In addition, many companies give a little dividend payment each year to the stockholders, providing extra income.

