At a high level. Philosophically, the way dividends should work is, some of the profit of the company is being passed to its owners.
Essentially the issue you're noticing is that when you buy a share of Microsoft, you are buying more than the dividend payments. You're buying all of the company's assets, and earnings, debts, etc; the company is a lot of things. There are a lot of different ways to measure the value of a company. One measure of valuation is the Price to net Earnings Ratio (P/E Ratio). Right now Microsoft's P/E ratio is 38.32. Microsoft's share price is about $342. With these two numbers we can infer that net earnings per share of Microsoft is about $8.92 per year. (342/38.32) By the measurement of the P/E ratio, you're buying the stock for a little more than 38 years of the company's earnings.
This means Microsoft, the whole company, earned about $9 per share. Microsoft pays regular dividends quarterly, the most recent dividend was $0.62, but in 2021 Microsoft paid shareholders $2.30. Microsoft shareholders received 25% of the profit of the whole company ($2.30/$9). How much do you think the company should send to you rather than reinvesting or otherwise allocating the capital?
Separately, dividends aren't "profit" to the shareholder. The share price is reduced by the amount of the dividend when it's issued. You'll receive your $0.62 per share, but the share price will be reduced by $0.62.
I personally like dividends, I think it's important for companies to be managed with the shareholders in mind and I don't want to be required to sell stock to unlock value, but a dividend payment is not the same as interest from a bank account or a bond coupon payment.
1: There are lots of companies that pay out more in dividends than their profit, that's an entirely different issue.