There’s a style of political autopsy designed mostly to demonstrate the genius of the pathologist: Dear candidate, if you had followed my advice, you would have won in a landslide.

There can be insight even in such self-involved efforts, but the shock of former president Donald Trump’s victory over Vice President Kamala Harris and the excruciating costs it might impose on our republic have inspired me to ask a different question: Why did I get it so wrong?

I genuinely believed Harris would win and that she had ignited a movement among women around not only reproductive rights but also to oppose the open misogyny of the Trump-Vance ticket. I also thought voters would appreciate the contrast between Harris’s unifying outreach as she closed her campaign and Trump’s angry endgame couched in violent language against his political opponents.

Yes, you could say I misjudged the national mood. I try to comfort myself by ascribing this to faith in my fellow citizens, whom I never expected to entrust the White House to someone with so little respect for our liberties and basic decency.

But the truth is I missed the signals and frustrations that were in plain sight. The worst part is that I would regularly cite them myself when describing the hurdles I thought Harris was overcoming. Five numbers — three about facts, two about feelings — go a long way toward explaining why Trump won.

The facts were part of a slide that Republican pollster Whit Ayres regularly included in his pre-election presentations. Ayres would contrast the average inflation rate during Trump’s and Joe Biden’s presidencies (1% vs. 5%); interest rates (3% under Trump, 6% under Biden); and the price of a market basket of food ($100 in the Trump years, $125 in the Biden years).

I’m sure there are many ways to measure these numbers, but the story Ayres told illustrates how deep discontent could coexist with an economy so good that the Economist described it as “the envy of the world.” Anger about prices trumped macroeconomic analysis.

It shouldn’t keep surprising us that Americans without college degrees are still upset after four decades of economic change imposing its heaviest burdens on them. The outcome will be a bitter irony for Biden, since much of his program was directed to help those left behind, and real wages after inflation rose most in the Biden years for the lowest-income workers.

Most voters didn’t feel it: Sixty-eight percent of them told media exit pollsters that they rated the economy “not so good” or “poor,” and 70% of them backed Trump. Even accounting for some partisan bias in people’s assessments of economic circumstances, it was a deadly problem for Harris.

Two other numbers explain why so many were happy to cast a Trump ballot in protest: Fifty-nine percent of voters disapproved of the way Biden was handling his job (44% strongly so), and 64% told Ipsos pollsters the country was on the wrong track. Only 17% said it was moving in the right direction. Maybe it’s a miracle Harris made the election as close as she did.

To say this is not to downplay the yet to be measured racial and gender bigotry Harris confronted. Nor should anyone pretend that economics explain everything that happened. Immigration was a signature issue for Trump, as it is for right-wing parties across the West. Anti-transgender messaging, built around Harris’s 2019 statement that the government should pay for inmates’ gender-affirming surgery, was a dominant motif in Trump’s advertising.

Electoral analysis offers no comfort to the half of the country that remains distressed and stunned that the other half was willing to overlook, and in some cases embrace, Trump’s incendiary rhetoric and hostility to the disciplines constitutional democracy requires. But my own misreading of 2024 might offer some lessons to those who take up the immediate work of checking Trump’s worst impulses — and the task of creating a majority to defeat Trumpism.

The honorable and remarkably successful “resistance” to Trump’s first term must be replaced by a new movement more attuned to the economic discontents Trump exploits. His populist bluff must be called again and again. His failure to offer remedies must be exposed, and Democrats need persuasive remedies of their own. The peril Trump represents to free institutions must be linked to the danger of corruption created by his dedication to friendly billionaires.

In broadening their coalition, advocates of cultural openness must remain steadfast in insisting on equal rights and equal treatment but avoid playing into the tropes and parodies created by their adversaries. Divisive culture wars are essential to Trump’s project. Harris understood this, and progressives should build on, not reject, her insistence on the values Americans hold in common.

The last thing Trump’s opponents wanted was to have to spend another four more years fighting his worst habits and inclinations. But now we must. We’d better do it right this time.

E.J. Dionne is on X: @EJDionne