There are two main ways for companies to finance themselves, debt and equity. Debt financing means that you borrow money and promise to pay it back on some set schedule with some set interest rate. Your creditors are entitled to exactly what you owe them, and if they don’t get it then they can sue you for the money, or put you into bankruptcy if you don’t have it.
Equity financing means that you sell stock to investors and you never have to pay it back. Your shareholders are not entitled to anything specific; there is no particular amount of money that they have to get back or any schedule for when they get it. But they are in some loose sense part-owners of the company, they have a residual claim on its cash flows, and they vaguely hope to one day get their money back through dividends or stock buybacks or mergers. They can’t make you share the profits in any direct way, but a share of the profits is what they want. And while there is no guarantee of what they’ll get, there is also no limit to it: If they buy 1% of the stock when the company is worth $10 million, they put in $100,000; if they then sell when the company is worth $100 billion, they get back $1 billion. That’s hard to do with debt.