Many stock markets allow you to buy and sell bonds, and shares.
You can buy and sell shares, and you can buy and corporate bonds of the listed companies.
Most investors do not become both shareholder and bondholder of the same listed company.
There is a fundamental difference between buying shares and buying bonds.
When you buy shares, you become the co-owner of the company.
When you buy bonds, you become the creditor or the banker to the company. You do not care if the company makes a profit of a million or ten million dollars.
You care about your coupon payment which is a fixed percentage. That means if you buy the bond at a rate of 6% coupon with $1000, you will get $60 per year, and year after year.
If you are the shareholder, your dividend depends on the profitability of the company for the year.
However, both shareholders and bondholders share the same risk when the company runs out of cash.
The bondholders will find that the company defaults on the coupon payment, and the shareholders will not get any dividend, and they will see the share price hits a new low.