Democratic National Committee Chair Tom Perez. (Alex Wong/Getty Images)

The race for chair of the Democratic National Committee was cast as a contest between the more centrist establishment and the left. Yet even though the left’s preferred candidate, Rep. Keith Ellison (D-Minn.) lost, the winner was no moderate. Tom Perez had a solidly progressive record serving in the Obama White House as head of the Justice Department’s civil rights division and secretary of labor. Yes, Perez supported the Trans-Pacific Partnership and is friendlier to financial interests than Ellison, but he will still easily be the most progressive DNC chair in years.

Given that there was little difference between Perez and Ellison on policy, why was Perez pushed to enter by the Obama White House and supported by the more establishment wing? Comparing résumés doesn’t answer the question: Ellison has more experience organizing in state and local races than Perez. The smears claiming Ellison was anti-Semitic were largely missing from the campaign. The only remaining reason for Perez’s entry and victory was simple: In defeating Ellison, the establishment wanted to rebuke the progressive wing and retain control of the party.

Therein lies Perez’s — and the party’s — biggest problem. The Democratic Party needs the progressive wing’s energy and new ideas if it is to recover. The hole is quite deep: Even if Hillary Clinton had squeaked out an electoral college victory, in the last 10 years Republicans gained both houses of Congress, 12 governorships and 850 state legislature seats. It’s fashionable to blame this entirely on President Barack Obama, but these across-the-board losses suggest the leadership issues run deeper. More than 800 state legislature seats lost is particularly remarkable in a such short period of time, something that could not have happened without institutional issues at multiple levels.

The fact is that the party establishment doesn’t want to admit its failings. As The Post’s David Weigel pointed out, the DNC establishment felt that “the death blows to the party’s 2016 campaign were struck by Russian hacking and by FBI Director James B. Comey.” To be fair, the data does suggest that Comey decisively affected on the election. But it was still the Clinton campaign’s fault that the gap was narrow enough that Comey’s indefensible actions made a difference. Most presidential campaigns have an October surprise — Hurricane Sandy in 2012, the acceleration of the stock market’s collapse in 2008, the Osama bin Laden tape in 2004 and so on. Campaigns may not know which way the surprise will cut, but that doesn’t excuse working to shore up key states to withstand a worse-case scenario, which the Clinton team did not do. And Comey and Russia certainly don’t explain the party’s poor record outside presidential races. Clearly a new approach is needed, particularly in terms of increasing turnout and pushing policies that motivate a larger number of voters to be enthusiastic about the party.

Rescuing the Democrats from this deep hole requires grass-roots energy — energy that clearly is most prevalent in the more liberal wing of the party, as seen in the surprisingly successful campaign of Sen. Bernie Sanders (I-Vt.). Capturing it means working with outside groups and listening to new ideas, not doubling down on establishment control. One of the great mistakes Democrats made in the Obama years was trying to channel the energy of his campaign through establishment groups such as the DNC, where it simply petered out. Perez made a symbolic gesture in the direction of a new way forward by appointing Ellison as deputy chair. If he and party officials at the state and local level can follow up on that — rejecting the “it’s not our fault” establishment attitude and being open to new ideas and to the energy sparked by Sanders and others — the party will be a much stronger opponent to President Trump.