In the five years since the 2008 financial crisis, there have been various attempts to make sense of what happened and why.

The latest — and, to my mind, one of the more convincing — comes in a new book, “Mortgage Wars,” by Timothy Howard, the former chief financial officer of housing finance giant Fannie Mae. Howard’s thesis is that the crisis was the result of a bitter and protracted political war that pit Fannie and its corporate cousin Freddie Mac against a group of giant banks and ideological foes determined to break their lucrative hold over the $11 trillion American home-mortgage market. In the end, Howard argues, the banks prevailed long enough to lead themselves and the rest of us over the cliff.

As Congress figures out what to do with Fannie and Freddie, which are now in government conservatorship, the worst mistake would be to get sucked back into refighting the old battles. Yet that is precisely how the debate is shaping up, with conservative ideologues once again railing against government interference in the free market, the mortgage-industrial complex waving the bloody shirt of “housing affordability,” and even the White House warning against a return to a “flawed business model” that, in truth, did precisely what it was intended to do.

Let’s be clear: Fannie and Freddie did not cause the financial crisis or the mortgage crisis that triggered it, at least not in the way their critics allege.

As Howard and others have pointed out, Fan and Fred’s giant portfolios of mortgage-backed securities — the portfolios bought with money borrowed at advantageous government rates that former Fed Chairman Alan Greenspan warned would one day lead to financial Armageddon — were not, in fact, the source of significant financial loss. They may have stopped throwing off profits during the crisis, but taken as a whole they didn’t lose much.

Fannie Mae headquarters in Washington. (GARY CAMERON/Reuters)

Nor did Fan and Fred get into trouble because of mandates from Democrats in Congress and from the Bush administration to provide more financing to low-income households. In fact, the bulk of the nontraditional loans that they bought at the height of the mortgage bubble brought them further from meeting their affordable housing goals, not closer.

As Howard tells it, the real story begins two decades ago, when big banks and other mortgage lenders sought a bigger share of a mortgage finance business that was generating year after year of double-digit earnings growth for Fan and Fred.

As government-sponsored enterprises, Fan and Fred had the advantage not only of access to cheaper funding, but also lower capital requirements than banks, effectively giving them the power to set the price of housing finance and underbid any competitor. And in their other role, as the dominant insurer of mortgage-backed securities, Fran and Fred could dictate the terms, structure and eligibility requirements of any mortgages that banks and other lenders might want to sell into the secondary market. They weren’t shy about using their market power to capture whatever surplus the industry had to offer while building formidable political machines to protect their lucrative duopoly from competition, criticism and regulatory encroachments.

By the mid-’90s, the campaign against Fan and Fred was in full swing. Academic papers and studies showed that most of the benefits of Fan and Fred’s government backing were going to shareholders and richly compensated executives, not homeowners. Ideological conservatives such as Greenspan were enlisted to warn of the dire risks to the financial system and the prospect of a massive government bailout. Newly resurgent Republicans in Congress, many supported by generous political contributions from the banks, called for legislation to cut Fan and Fred down to size. Even top officials of the Clinton administration’s Treasury Department, angered by Fan and Fred’s political bullying and frustrated by their unwillingness to accept any meaningful reforms, turned against them.

The beginning of the end came in 2004, when Fred and then Fan got tied up in accounting scandals that few people understood and, as subsequent litigation revealed, turned out to be less scandalous than first portrayed. But in the overheated political environment that the banks had created, the restatements were enough to force the resignation of top executives at both firms, including Howard, and send the firms into a full-blown political and regulatory retreat from which they never recovered.

In the meantime, thanks to low interest rates, a booming housing market and lax federal regulation, the banks and their financial allies had set up an alternative system for financing home purchases using types of mortgages Fan and Fred normally ignored: “Subprime” mortgages to people with blemished credit records. “Alt-A” mortgages that didn’t require documentation of income. “Interest-only” mortgages that required no repayment of principal. “Option ARM” mortgages that allowed borrowers to make whatever monthly payments they chose.

The aggressive marketing of these mortgage products by the banks and their Wall Street allies had two notable effects. First, it turned a booming housing market into a speculative bubble, particularly in California, Arizona and Nevada. Second, it reduced Fan and Fred’s share of newly issued mortgages from 70 percent of the market in 2003 to 40 percent by 2006. Fan and Fred were no longer setting prices or lending standards — the banks and Wall Street were.

It was only then that Fan and Fred, desperate to recover market share and double-digit earnings growth, relaxed the standards for the mortgages they would buy and guarantee. In the end, Howard estimates from public filings, losses from those nontraditional mortgages bought in the three years before the crash accounted for at least half of the $120 billion in credit losses ultimately suffered by Fan and Fred. The rest were the result you would have expected for the country’s largest mortgage insurers after a giant bubble burst.

In other words, if anyone can be said to have caused the housing crisis, it was the banks and their Wall Street allies, abetted by regulators who were either clueless or blinded by their free-market ideology. Not that Fan and Fred were blameless. Although Howard glosses over this point, their arrogance and political intransigence set the stage for the mortgage wars. And their desperate attempts to regain market share further inflated the speculative bubble that the banks created.

But here’s the thing: While Fan and Fred wound up with credit losses that were roughly double the capital they were holding, their ensuing government rescue didn’t cost the taxpayers a dime. The reason is quite simple. In the years since the crisis, Fan and Fred stepped in and did what they were created to do — provide mortgage financing and guarantees when private lenders and insurers would not. Not only have they kept the housing market afloat, but all that new business has also proven so profitable that the Treasury has been repaid the $186 billion it provided during the crisis, and is even expected to earn a profit of at least $50 billion.

What the government did for Fannie and Freddie, in effect, was no different than what it did for the banks. Yet while the banks have re-emerged as profitable, well-capitalized private companies whose shareholders have done well in the past few years, Fan and Fred remain captives of the government, their assets and profits confiscated and their shareholders effectively wiped out. The government’s use of Fed and Fan as a piggy bank has become so egregious that the bottom-fishing hedge funds that now hold most of their shares have a good chance of prevailing in lawsuits against the government alleging illegal and unconstitutional seizure, an outcome that could cost taxpayers tens of billions of dollars in damages.

This clearer understanding of what happened makes it easier to understand what needs to be done.

For starters, the Fan and Fred duopoly has to end. They must be stripped of their special powers to borrow money at government rates, and they must be required to license their valuable software and databases to other private firms so these firms can enter the market on equal terms. The government would need to tightly regulate all such mortgage packagers and guarantors, and require them to raise enough capital to survive a crisis as big as the last one and pay the government an annual premium to insure them against losses in excess of their capital. That regulatory structure should sound familiar, since it is exactly what the government does with banks.

There is still an open question as to how much capital should be required. The leading proposal by Sens. Bob Corker (R-Tenn.) and Mark R. Warner (D-Va.) sets it at 10 percent, a ridiculously high number that Corker apparently picked out of the air to placate Fan and Fred’s longtime opponents. Five percent would have more than covered the losses from the last crisis while pushing up mortgage rates by a more tolerable half a percentage point.

The Corker-Warner proposal has two other glaring flaws. One is that it provides no mechanism for the government to step in as a lender of last resort when private banks and investors decide to flee the mortgage market, as history shows they regularly do. For conservatives to claim, as they do, that this is not a proper role for government is hard to square with the fact that it is precisely what they have demanded that Fan and Fred do since 2008. We know now that a lender of last resort can prevent a sometimes-irrational market from failing and stabilize the economy at little or no long-term cost to taxpayers.

The proposal’s other flaw is its stake-through-the-heart treatment of Fan and Fred. The bill demands that all employees be fired, everything of value be sold off for the benefit of the government and the companies close their doors. Not only would that destabilize the recovering housing market, but it also all but guarantees that the banks and Wall Street will realize their long-standing goal of stealing away one of the Washington region’s most important industries.

It is hard to understand why Warner, the senior senator from Virginia, would demand the liquidation of Freddie Mac, one of the largest employers in his state. Instead, he ought to be joining with the rest of the region’s politicians in demanding that Fan and Fred be reformed, recapitalized and preserved as part of a new and more competitive housing finance infrastructure anchored in Washington, not Wall Street.