The mortgage insurance premiums paid to HUD in FHA mortgage transactions covers losses experienced by mortgage lenders in foreclosure.
The FHA program was the first program to offer liberal income qualifications and low downpayments. In ye ole times - LOL - pre-subprime - lenders were afraid to take risk, so HUD built the mortgage insurance into the program to incent mortgage lenders to participate.
I really like the good old fashioned program that it is. Many, many people are responsibly able to purchase homes. It's a good marriage of responsible government, responsible mortgage underwriting, and responsible homebuying. Everybody is reasonably safe.