With all the talk about mortgages, lots of folks don't understand what really happens behind the scenes after a mortgage is made. Calculated Risk has two primers on the mortgage securities market, but first I'm going to lay the scene with real basic stuff. Links below. Note: if you received an MBA in finance from Wharton last year, you'll find this terribly basic.
First you need to understand the basics of stripping. (not pole dancing, but tearing coupons off of bonds.) Let's say you have a two year Treasury bond. It pays interest twice a year (by convention), plus principle is repaid upon maturity. So you really have four payments coming: interest in six months, interest in 12 months, interest in 18 months, and principle plus interest in 24 months. You can take the bond and strip it into its four parts, and sell each one individually. That way, even though the treasury does not sell 18-month zero coupon bonds, a person can buy such a thing through a stripper.
Why would would an investor want just parts of a bond? It's easier to imagine with a 30-year bond. A life insurance company is paid a premium today, but knows that some of the money it will eventually pay out won't be needed for 20 to 30 years. That company buys the payments that will arrive in 20 to 30 years. Why don't they buy the whole bond? They don't want interest income next year; they would just have to worry about getting it re-invested. (to the MBAs reading this: I know, this story is being terribly simplified. Go read something else.) Who wants the earlier payments? A medical malpractice insurance company might figure that it won't need its money for 7 to 10 years; a car insurance company might want money back in 6 to 12 months. Different investors have different needs. And those who are flexible in their needs pick up the odds and ends that nobody else wants, getting a tiny premium for doing so.
With mortgages, the same applies, but there's a problem: some borrowers prepay. And it's not easy to know exactly when that will happen.