How does this work in the American economy? Why does anyone buy RMBS at such low yields for 30 years with the capital risk that the money could come back to you if rates move against you?
US has Freddie Mac and Fannie Mae that essentially buy all OK mortgages from the banks so long-term liabilities don't ruin banks and FED can create more reserves when needed.
> Freddie Mac and Fannie Mae that essentially buy all OK mortgages from the banks so long-term liabilities don't ruin banks
FDMC/FNMA mostly buy up conforming loans and repackage them. In theory the bundling and government sponsored entity's (GSE) own equity would protect buyers of these repackaged bonds. In practice they did not and the government had to step in.
However, none of this protects against interest rates. If you take a bunch of 2 percent APY loans and bundle them, the resulting bonds are still 2 percent APY and everything seems good from GSE perspective. If rates rise to 7 percent, its just as easy to buy 7 percent rate conforming loans and bundle them into bonds paying 7 percent.
The problem OP brings up is one which the GSEs do not solve: if I own a 3 percent bond but the GSEs are selling 7 percent bonds, I have to sell mine for less than what the GSEs do to compete. The rule of thumb is the asset value drops one percent per APY point below market _per year of duration_. Knowing this, you would naturally shy very far away from mortgages because every percentage point is 30 percent of your delta. (It's a heuristic though, so its not like the example I gave actually trades at a negative price; performs better during "normal" sub 1pct changes.)
In practice people try to find arbitrage opportunities with ever more sophisticated instruments like interest rate swaps to "hedge the risk," but if markets are efficient this is a very small delta that could end up being a negative number. What we saw in 2008 was that the buyers were things like money market funds that prioritized retention of principal, but were dabbling in yield[1] enhancement strategies, given the whole "zero interest rate environment" thing.
Simple answer is prepayment risk is baked in into spreads. That is why it is higher than in Europe especially now give the risk of prepayment (in the form of refinance) is probably at all times high
Lenders are making certain bets that can come back to bite them. There are also various ways to hedge with credit swaps. etc. (Also per other comments, as a matter of policy, the US government has long wanted people to own homes.)
You typically can pay off mortgages in the US early but there's nothing magical about a loan generally that says I can just pay it off at any time for free. It depends on the term of the loan I signed. I may have lent you money because I want a steady stream of income for the next ten years.
It's the same way some bonds are callable and others aren't.