Those who buy shares/stocks become owners and are called shareholders. Now they have claims not only on the profit or Earnings that the company is making, but also on the Assets or the properties that the company possess.
So, you as a shareholder own a part of the property. Now, along with it comes the voting rights. If they’ll need your vote or not is a different story. We can discuss it in some stage, not now. Let’s keep things simple as of now.
You receive Dividends or claims on a part of the profit of the company if the company board of directors, or the higher management, agree to pay you. Dividend is not therefore guaranteed. We will discuss details about it in the dividends section.
Hence, you have every reason to buy stocks from a profit making company. Most often they pay dividends to keep the shareholders interested in the company. And you can make good money from it.