Only interest on savings truly "compounds", but you can get a similar effect by reinvesting gains on investments, whether it be stocks or bonds. The overall value of the equity (stock) market tends to increase exponentially (which has the same mathematical effect of compounding interest) because companies take the earnings that they make and reinvest part of them back in the company. Thus the companies themselves reinvest their earnings, which is reflected in the stock prices. Dividends do not factor into compounding because when a company issues dividends, the cash is removed from the company, and the value of the company (and the stock) drop proportionally. e.g. If a company issues a $1 per share dividend, the value of the stock drops $1 after the dividend is paid. If you reinvest that dividend in the same company, you still have the same total amount invested in the company.
Bonds do not "compound" in that sense. Most pay out interest periodically, which you can reinvest into other investments, but the vast majority of individual bonds themselves do not compound their interest. However, the value of a bond (meaning what buyers are willing to pay for a bond) takes compounding into effect in a way. A zero-coupon bond (meaning a bond that pays no interest), will be sold at a discount equivalent to the effect of compounding the returns on an investment of similar risk. So a $1,000 5-year zero-coupon bond that sells for $783.53 has an "effective" interest rate of 5%, since if you "saved" $783.53 at 5% annual interest, in 5 years you'd have $1,000. The market has determined that 5% is a reasonable annualized return for an investment of that risk.