The Democratic Party has been obliterated. Hillary Clinton's narrow loss to Donald Trump was the shock felt 'round the world, but there's been an even deeper decline in the Democratic Party at the state and local level. The Obama administration has overseen the loss of roughly a tenth of the party's Senate seats, a fifth of its House and state legislative seats, and a third of its governorships, something which hasn't been seen since the repeated routs of Republicans in the 1930s.

There are unquestionably many factors behind this result. But I want to focus on the biggest one that was completely under Democrats' control. It is the same thing that killed the Republicans of Hoover's generation: gross mishandling of an economic crisis. Democrats had the full run of the federal government from 2009-10, during the worst economic disaster in 80 years, and they did not fully fix mass unemployment, nor the associated foreclosure crisis. That is just about the most guaranteed route to electoral death there is.

I wrote previously about how in the 1970s, the Democrats gradually embraced the neoliberal ideology of markets and deregulation, setting the stage for later disasters. One under-noticed corollary of this was forgetting the previous generation's economic wisdom. More and more, Democrats embraced the ideas that markets were self-regulating, that unions were not worth defending, that monopolies were nothing to get worked up over, and that large deficits were by definition bad.

A similar process of forgetting had been happening within the profession of economics, and so outside of a small minority of heterodox critics, the 2008 Great Recession struck economists unawares. The ones who hadn't forgotten their Keynes and Minsky, like Paul Krugman, quickly regrouped and presented the Democrats with the policy that solved the Great Depression: huge fiscal and monetary stimulus. When there is a self-fulfilling collapse in spending, the government must step in as the spender of last resort, as it did during the New Deal and World War II.

In the early months of the Obama administration, when it seemed like the world was falling apart, this logic gained much purchase, leading to the passage of the Recovery Act stimulus package. But even then Krugman and company ran headlong into a problem of ideology. Centrist Democratic senators insisted, for no reason other than sticker shock, that the stimulus could only be so big — not even close to the estimated size of the economic hole left by the collapse. Krugman's arguments that it should be massively larger than that estimate — in order to hedge against an underestimation of the size of the collapse, which was prescient indeed — fell on deaf ears.

And after the first stimulus failed to restore full employment, the ideology problem got much worse. The D.C. political and media elite, including President Obama and most other Democratic big shots, became absolutely obsessed with cutting the deficit. The ensuing austerity (much of it caused by post-2010 Republican obstruction, to be fair) dramatically slowed the recovery. It is only in the last year that unemployment has declined to a reasonably good level, and the fraction of prime working-age people with a job is still worse than the bottom of the previous two recessions. What's more, the fruits of the recovery have been highly unequal, with much of the income flowing to the top 1 percent, and most rural places left out. (Sound familiar?)

The problem was that the party never really internalized the logic of Keynesianism, and as a result was incapable of thinking strategically about their political position. Neoliberalism had become a hegemonic ideology, which takes serious effort to lever out of someone's head, and nobody was in a position to do it. Practically the whole party — and indeed the "nonpartisan" media as well — had been raised on the idea that deficits are bad for their entire lives (cemented in place by hundreds of millions of dollars in agitprop spending from Wall Street ideologues). Keynesianism — which implies things like "you can fix a recession by printing money and handing it to people" — sounded extreme and suspect. Media budget coverage to this day is usually written with an implicit presumption that deficit cutting is the ultimate good in budget policy.

That's how the party ended up with its most vulnerable members — centrist Blue Dogs in the South — hawking austerity during the worst mass unemployment crisis in 80 years. Almost all of them lost in 2010. That loss, in turn, paved the way for many of the other major problems Democrats are having. That was a census year, and huge Republican victories allowed them to control the subsequent redistricting process, in which they gerrymandered themselves a 7-point handicap in the House of Representatives and in many state legislatures.

That brings me to the foreclosure crisis, the handling of which was even worse. Instead of partially ameliorating it as with employment, the Obama administration helped it happen. As David Dayen writes in Chain of Title, the financial products underpinning the subprime mortgage boom were riddled with errors, and in order to be able to foreclose on people who had defaulted, they had to commit systematic document fraud. This epic crime spree gave the White House tremendous leverage to negotiate a settlement to keep people in their homes, but instead the administration co-opted a lawsuit from state attorneys general and turned it into a slap on the wrist that reinvigorated the foreclosure machine. There was also $75 billion in the Recovery Act to arrest foreclosures, but the administration's effort at this, HAMP, was such a complete disaster that they only spent about 16 percent of the money and enabled thousands of foreclosures in the process.

As a direct result, the homeownership rate has plummeted to levels not seen since the 1960s.

This disaster is somewhat harder to explain, because it seems so nuts. Why on Earth would anyone do this? Once again I think the problem is ideology. Neoliberal-inspired deregulation hugely empowered the financial sector, and finance — fueled by impressive-sounding and complicated products developed by the some of the smartest people in the country — came to occupy a disproportionate portion of total economic output and an even larger fraction of corporate profits. From thence it became a major source of campaign contributions. As Washington became saturated with the money and ideology of bankers, assisted by partisans of the "self-regulating market" like Alan Greenspan, it came to seem that the main task of banking policy was keeping an increasingly bloated and unstable Wall Street on its feet.

So when the crisis happened, the main thing the political system managed to do was fling money at bankers until the financial sector was stabilized. Afterwards, the idea that bankers might have committed crimes — might in fact have had whole floors of people committing crimes all day long — was simply too big to swallow. So Democrats — many of whom no doubt had plush consulting gigs in the back of their mind — basically looked the other way. No bankers went to jail, and over nine million people lost their homes.

This is not to absolve Republicans of their obstruction in Congress or President-elect Donald Trump or anything else. But the fact of the matter is that Democrats had two golden years to fix the depression, restore the housing market, hold Wall Street to account, and cement a new generation of loyal Democrats, and they bobbled it.

President Obama's spectacular charisma — and his savvy campaign against a filthy rich vulture capitalist in 2012 — papered over these problems to some extent. But for most of his presidency America has basically ceased to function for a huge fraction of the population. Fair or not, the party perceived to be responsible for that situation is going to be punished at the polls.

This is the first article in a four-part series on the Democratic Party. Read the second article here.