WASHINGTON—Donald Trump and Joe Biden have divergent views on the federal government’s role in the $11 trillion mortgage market, with potential consequences for the price of home loans for millions of Americans.

In keeping with the Republican Party’s emphasis on limiting the government’s role in the economy, the Trump administration aims to return two giant mortgage-finance companies—Fannie Mae and Freddie Mac—to private hands over the next couple of years.

A Biden administration, in contrast, would be in no hurry to release the companies, which the government has controlled since 2008. Instead, the Democratic former vice president would focus on ways to use the companies to boost housing affordability and promote homeownership.

Here is a look at the competing policies and what either approach might mean for housing-market consumers.

What’s at stake for borrowers?

Mortgage affordability could be affected. The Biden camp argues that the Trump administration’s approach would bring higher mortgage rates. Republicans say the government should play a smaller role backstopping the mortgage market, and that any increase in rates would be minimal.

What are Fannie and Freddie?

The U.S. government created the mortgage finance companies to promote affordable homeownership. President Franklin D. Roosevelt created Fannie Mae in 1938 to help provide money for home mortgages and spur housing construction. Freddie was created in 1970 to cater to smaller lenders.

Fannie and Freddie don’t lend money directly to home buyers. Instead, they buy mortgages from lenders, repackage them into securities and sell those securities to investors.