On Friday, one of the most intelligent, exacting, efficient home lenders reported remarkably impressive profits. If you wanted proof that housing is back, this was it. The company reported full-year profits of more than $10 billion, rising market share, and boasted that only the tiniest percentage of loans it had made had gone sour. With home prices rising and borrowers doing a better job keeping up with payments, the lender was able to release reserves that had been set aside to deal with bad loans, which further boosted profits.

The same day, one of the most reckless and profligate home lenders reported far less impressive results. Hamstrung by the lower standards of the boom years, it reported that it was still coping with the overhang of the bubble. Mortgages continue to go bad at an alarming rate. And there’s no sign that it will be able to pay off the huge amount of government aid it took in 2009 and 2010.

They’re the same company: Freddie Mac.

The mortgage giant, now owned by the federal government, is a sort of financial Dr. Jekyll and Mr. Hyde, a split-personality institution. It’s a really brilliant, smart, and careful mortgage lender that co-exists in the same body with an incredibly stupid one. And nowhere was this dichotomy more clear than in its fourth-quarter earnings report.

First, the good news. With the collapse of the mortgage market, Freddie Mac and its sister, Fannie Mae, are essentially the only games in town. The overwhelming majority of loans made these days are either purchased or guaranteed by Fannie or Freddie. Which means Freddie can uphold higher standards. Scroll down to page 6 of the report. The company states that for loans made since 2008, which now constitute the bulk of its portfolio, the typical loan-to-value ratio is about 70 percent. That means the typical borrower showing up as a new customer is either making a 30 percent down payment, or is refinancing a home in which the equity is about 30 percent of the total value. That means borrowers have plenty of their own cash at risk, making them less likely to default. In addition, the typical credit score for a post-2008 borrower is a healthy 755.

What’s more, the overall environment has improved a great deal. Housing prices are generally down from their peak, interest rates are down, and the employment situation is improving. That means borrowers are stretching less to buy homes and are better able to keep up with payments. So on the loans it has made since 2008, only .39 percent, or less than four out of every thousand loans, are seriously delinquent. That’s extremely impressive, and those loans, which account for 63 percent of Freddie’s total portfolio, accounted for a mere 4 percent of Freddie Mac’s credit losses in the most recent quarter.

All that adds up to better profits. Freddie Mac borrows money for very little (it has the government behind it), lends it out for a bit more, and racks up steady profits as the payments come in: $4.5 billion in the fourth quarter and about $11 billion for the full year. It has stopped drawing on the support the taxpayer has extended, and is instead paying out its earnings as dividends to the Treasury Department. In 2012, Freddie Mac paid $7.2 billion in dividends to the government, and it has returned $23.8 of the roughly $71 billion in taxpayer funds it took.

At the same time, of course, Freddie Mac remains a really pathetic, government-dependent institution crippled by poor decisions made during the credit bubble. Between 2005 and 2008, as the subprime industry ran rampant, and as prices were driven to insane levels, Freddie Mac joined the party. It made lots of loans to people with lower credit scores, against very expensive homes that have subsequently declined in value. And it continues to suffer from a hangover, having already set aside $75.2 billion for credit losses due to losses made between 2005 and 2008. And there’s likely to be more to come. Nearly 10 percent of the loans made between 2005 and 2008 are seriously delinquent. The 2005–08 vintage loans accounted for a full 87 percent of the company’s credit losses in 2012. They continue to clog up the company’s balance sheet.

The good news? As those loans default, or are refinanced, or as the homes on which they rest are sold, they continue to disappear from the company’s balance sheet. At the end of 2012, the 2005–08 loans accounted for only 24 percent of Freddie Mac’s total portfolio, down from 32 percent the year before. With each passing week and month, more of those poorly made loans disappear.

Still, even in this benign environment for lenders, Freddie Mac remains crippled by the bad boom-era bank residing within its walls. Despite racking up large profits, the company still owes the taxpayer about $47 billion. Freddie Mac could turn over every penny or profits it makes over the next five or six years to Treasury and still not make the government whole on its “investment.”