I wouldn't hold up Fannie and Freddie as a model for anything.
https://www.seattletimes.com/business/franklin-raines-to-pay...
So if a bank offers a mortgage to a customer and the loan conforms with Fannie and Freddie's underwriting policies, Fannie and Freddie will buy it from them them. They then package some of those loans into a loan portfolio and sell it to fixed income investors.
About 70% of US mortgages are supported by Fannie and Freddie.