The Democratic establishment played its cards exactly right in California — much to my surprise.

I watched the developments in Golden State politics this year with a mix of worry and annoyance. A coalition led by the state’s conservatives collected enough signatures to force a recall election against Democratic Gov. Gavin Newsom. And the California Democratic establishment, instead of coalescing around an alternative candidate in case voters decided to oust the incumbent, doubled down on Newsom. They convinced all of the state’s prominent Democratic officials to stay out of the race. And they urged rank-and-file Democrats to vote “no” on recalling Newsom and then leave blank the part of their ballot where they could choose among the 46 people running to replace the governor.

I was annoyed that California’s Democratic establishment was, in my view, either missing or ignoring political realities by not running an alternative to Newsom, who is a favorite of party insiders but not the most inspiring politician. And I worried about the worst-case scenario: Newsom is recalled; 88-year-old U.S. Sen. Dianne Feinstein can no longer serve due to health reasons; and a Republican governor replaces Feinstein with someone who would put the GOP in control of the U.S. Senate, hamstringing President Biden.

I was wrong and the Democratic establishment was right. Newsom overwhelmingly (64.2 percent to 35.8 percent with 66 percent of votes counted) defeated the recall effort. While that victory was in large part because California is a very Democratic-leaning state, the strategy of California Democratic leaders helped ensure the recall was unsuccessful.

If Democrats had embraced a candidate just in case Newsom was ousted, the race would have become essentially Newsom vs. Democrat X vs. Republican Y. Perhaps the Democratic alternative would have come out first among the dozens of candidates. But having a real Democratic alternative would also have created incentives for Newsom and the other Democrat to (either directly or indirectly) compete with one another, weakening them both.

Instead, Democrats forced voters to either back Newsom or choose a Republican for governor. This approach tilted the race heavily in Newsom’s favor, since California is so blue that Biden won there by 29 percentage points in 2020.

“We were creating the race we wanted — a choice, not a referendum” on the governor, Newsom senior adviser Addisu Demissie told me, acknowledging that some Democrats in the state were uncomfortable with this approach. “Was it risky? Technically, yes. But by making it all or nothing, we were making it more likely for us to win.”

Newsom and his allies got a gift from California Republicans along the way. The state’s GOP could have coalesced around one of the more moderate Republicans on the ballot, someone who might appeal to Democrats who don’t love Newsom. That’s what happened in 2003, when voters booted then-Democratic Gov. Gray Davis, in part because the moderate Republican Arnold Schwarzenegger was running. But this time the California GOP got behind Larry Elder, a talk-show host with deeply conservative policy views. As Elder became the front-runner among the replacement candidates, support for recalling Newsom dipped.

The rise of Elder, whom Democrats cast as a California Donald Trump, was “perfect,” Demissie said. “Couldn’t have been better. He made no effort to appeal to anyone outside of his base.”

The biggest lesson from this race is that California should immediately change its recall law, which mandates a recall election for a statewide elected official if just 12 percent of voters sign a petition supporting it.

But I think there are also lessons from California for Democrats as they prepare for 2022. Newsom’s most effective strategy was not talking about how California’s economy has improved under his leadership or the long list of progressive policies he has signed into law. Instead, Newsom and his campaign relentlessly focused on Elder, casting him as extremist. And they emphasized that Newsom supported vaccination and mask-wearing requirements and other common-sense policies to reduce the spread of covid-19, much of which Elder opposed.

As the campaign progressed, Newsom seemed almost apologetic about his negative campaigning and has said he will run more on his record in the regularly scheduled gubernatorial election next year.

He has nothing to apologize for — and Democrats across the country should consider adopting his approach. Democrats are deeply invested in the idea that voters will reward them for creating the perfect child tax credit or jobs plan. But many policies, particularly on economic issues, are complicated and dry. People might not understand that they got a tax credit or forget about it when it comes time to vote.

Mask-wearing and vaccinations, on the other hand, are easy to understand. And Newsom’s covid policies demonstrated, in a clearer way than tax credits would, the governor’s broader values, which I think is what actually drives people’s votes. Newsom was essentially arguing that he is a rational, common-sense person who cares about saving people’s lives during a deadly pandemic, while Elder is an out-of-control ideologue.

Newsom’s values are of course much more popular than Elder’s in a blue state such as California. But nationally the 2018 and 2020 elections also featured Democrats running against Trumpism and portraying themselves as the party with normal values — and they won control of the House, Senate and the presidency. Newsom’s victory suggests that running as the anti-Trumpism party still has real political value, even with Trump no longer in the White House.