https://bebusinessed.com/history/history-of-mortgages/
Fannie and Freddie basically agree to "back" those new mortgages (typically buying them from banks and selling them off later) as long as they conform to certain requirements - 15 or 30 year terms, 10-20% down payments, etc.
It's a massive subsidy for the housing market in the US, but also addresses the social goal of making housing accessible. You can get a mortgage and the monthly payment (interest + principle) never changes over the 30 year life of the loan.