Why do they need to share their profits? Can’t they keep it to themselves?
This is what in your mind. Then let me tell you a story.
Suppose a company wants to raise money for a purpose, say making it bigger. Now where do they go? They can borrow money from banks or people at a certain rate of interest, also called Debts (Debt Financing), or they can sell a part of the company and get the money, called Shares (Equity Financing). Many companies go for Shares, because they don’t need to pay back the money and it is interest free too! The first share offering of a company is called Initial Public Offering (IPO). The place where these IPOs are sold is called Primary Market. Secondary Markets, which we mentioned earlier in reference to modern stock exchanges, are the stock exchanges we normally see where people sell or buy the previously issued stocks. Companies don’t sell directly in the Secondary market.
Why will you buy their shares or IPOs if they are not going to pay back the money? Because of the hope that someday the stocks you bought will be more than the amount you paid to buy them. And that people will start offering you more money to buy them from you.