The apartment-lending units of Fannie Mae and Freddie Mac were among their few money makers after the U.S. housing collapse. Now they should help transform the U.S. mortgage industry.

Lawmakers seeking to eliminate the two government lenders, which were seized by regulators during the 2008 credit crisis, see an antidote to the reckless lending that blew up the U.S. housing market in the structure of the firms’ multifamily operations, which share risks with lenders.