The single fact that organizes everything else is that a bondholder is a creditor. A stockholder holds a residual claim and is paid only after everyone the company owes has been settled with; a bondholder is one of the parties being settled with first. So the two instruments sit on opposite sides of the same sentence, and the ranking explains their behavior in both directions. Because the payments are promised, they are steadier and the investment is ordinarily less volatile. Because the payments are only what was promised, an issuer that triples in value owes its bondholders exactly the same interest it always did. Bonds are not the safe version of stocks; they are a different bargain, in which a capped return is exchanged for a senior claim.
The mechanic that surprises people is that a bond's market value changes after you buy it, and moves opposite to interest rates. If comparable new bonds start paying more than yours does, nobody will pay full price for yours, so its price falls until the deal is competitive again. If new bonds pay less, yours becomes worth more. A holder who keeps the bond to maturity collects the promised interest and principal regardless, so the price change matters only on a sale. This is also where a bond fund behaves unlike a bond, which is the distinction most often missed. An individual bond has a maturity date and repays a known amount on it, so an owner can wait out a price decline. A fund is a continuously managed pool with no maturity date, so its share price simply reflects what its holdings are currently worth, and a shareholder has nothing to wait for. A fund of high-quality bonds can post a real loss in a year when no issuer it holds missed a single payment.
Who is borrowing is the other axis, and the SEC groups issuers three ways. U.S. Treasury securities are obligations of the federal government, issued as bills, notes, bonds and inflation-protected securities. Treasury also sells savings bonds directly to individuals, including Series EE and the Series I savings bond, whose rate is reset twice a year from a fixed component and an inflation component; unlike the securities above, these are not traded, so you buy them from and redeem them with the government. Municipal bonds are issued by states, cities and their authorities, and are usually distinguished by whether a general taxing power or a specific revenue stream stands behind them. Corporate bonds are issued by companies. Cutting across all three is credit quality: rating agencies grade issuers, and the market divides them broadly into investment grade and high yield, the latter still widely called junk. A higher stated interest rate on a lower-graded issuer is compensation for a greater chance of not being paid, not a better deal that somebody overlooked.
The SEC names five risks a bond investor carries, and each is worth recognizing by name because they are not variations of one thing. Credit risk is the issuer defaulting. Interest rate risk is the price effect above. Inflation risk is that a fixed payment buys less over time, which is a real cost on a long bond even if every payment arrives. Liquidity risk is difficulty finding a buyer at a fair price. Call risk is the issuer repaying early when rates fall, handing back your money precisely when you can no longer replace the income.