Bonds are like CDs except that they have longer terms. Therefore, in general, bonds give a higher return to compensate the investor for tying up their money for a longer time.
If you hold a bond to maturity, and if the bond issuer does not go bankrupt, you will be guaranteed of getting your money back plus the interest promised to you. If you need to sell your bond before maturity, you may or may not get your full prinicple back. The reason is interest-rate risk.
Interest-rate risk is just another way of saying that the PV of money to be received in the future depends strongly on the interest rate used to discount the future cash flow. For example, suppose you bought a zero-coupon bond today that promised to pay your $1,000 ten years from now. The PV of that bond would be
$1,000 / (1+i)^10 . (Eq. 10)
If i=.1 now, you would pay $386 for that bond.
Suppose interest rates increase tomorrow to 11%. Investors could buy similar bonds for only $352, and therefore you would only be able to get that much for your bond if you tried to sell it. You would have a loss of $34, 9% of your principle, if that happened. On the other hand, if interest rates declined tomorrow to 9%, you would have a gain of $36, 9% of your principle. Clearly, the longer maturity involved, the more interest rate risk to which you are subject.
Bond funds in general don't ever mature. Each bond fund has a target range of maturity dates that they preserve by trading bonds in their portfolio. Therefore one of the most important things to consider before investing in a bond fund is what is their average maturity. Bond funds with longer maturities will in general offer higher returns, but with increased interest rate risk.
Junk bonds
Junk bonds are a relatively new class of securities that offer higher returns because the bonds are not "investment grade". That is, there is a higher risk of default (bankruptcy). For compensation, companies offering junk bonds must pay higher returns. The question being debated now is whether the higher returns being offered are high enough to offset the levels of bankruptcy that might be expected in the next recession. In the last few years, outside of recession, a portfolio of junk bonds has outperformed a portfolio of investment-grade bonds.
Everyone agrees that one should not put much of one's wealth into junk bonds.