Let's start with stocks here, and then get to dividends.
Stocks are pieces (a.k.a. "shares") of a company's equity.
A company can decide to sell these shares for cash. In return, they give up a piece of their ownership in the business!
To conceptualize this, let's walk through a few sample scenarios with a simple lemonade stand!
Scenario: You run a lemonade stand, and it has become more-and-more successful. People have been wanting to buy ownership in the company, so you decide to sell 100 shares of $1 par value common stock at $10 per share.