Fannie and Freddie buy FHA, VA and conventional mortgages that meet their standards, while Ginnie buys only FHA and VA loans. After selling a loan, the local lender gets cash in return. With dollars in the vault, the lender can turn around and loan again. In this process everyone gets something. Borrowers get loan money at the cheapest possible cost anywhere in the country.
Lenders make money from the fees they charge for originating loans.
They may also get addition profits if they originate a loan which can be sold at a premium. Being able to sell loans in the secondary market means that lenders can recycle cash and make additional loans that generate new fees and profits. Investors who buy bonds, certificates, and securities get interest and possibly higher market values. Fannie Mae, Freddie Mac, and Ginnie Mae get fees for their work, and also interest from the mortgages they hold. Then the likely result would be rising mortgage rates.