The gubernatorial primaries in Virginia on Tuesday were supposed to be about the fight over the Democratic Party’s soul.

National profile after national profile of the race (including Vox’s) focused on the battle between Lt. Gov. Ralph Northam and former Rep. Tom Perriello (D-VA). Did it represent a Bernie Sanders versus Hillary Clinton rematch? Or a key test run for the populist progressive movement?

Then the election was held, and a different storyline caught the political world off-guard. Northam, with the overwhelming support of Virginia Democratic officials across the state, crushed Perriello by 14 points. What shocked observers instead was the Republican primary, where Corey Stewart — a Confederate sympathizer and onetime campaign official for Donald Trump — came within just 1.2 points of beating former Republican National Committee Chair Ed Gillespie.

Like Jeb Bush in the Republican presidential campaign, Gillespie entered the race with massive advantages in spending, official endorsements, and name recognition. By contrast, Stewart attacked Gillespie online as a “cuckservative,” accused his opponent of treating “Donald Trump like he had typhoid,” and vowed to crackdown on immigrants and protect Confederate monuments if elected. It was quite a comeback: This fall, Stewart was fired from his position as Trump’s Virginia campaign chair after calling the RNC “establishment pukes” on Facebook.

And he almost won. “Stewart demonstrated that the seemingly disenfranchised conservative voter who supported Trump so strongly across the country is still there,” said Quentin Kidd, a political scientist at Christopher Newport University, in an interview. “What happened tonight is that the 37 percent of Virginia voters said Trump is doing a good job came out and voted for Cory Stewart in a Republican primary. They’re still a potent force.”

On Tuesday night, I spoke with Kidd over the phone about how to interpret Stewart’s remarkably strong finish and what it may mean for national politics. A transcript of our conversation follows.

Jeff Stein

You and I both expected to be up tonight talking about the down-to-the-wire Democratic primary for governor, and it instead looks like it’s the Republican race that’s really shocking everybody. How did we all get the real story here so wrong?

Quentin Kidd

I think what happened tonight is that Corey Stewart demonstrated that the seemingly disenfranchised conservative voter who supported Trump so strongly across the country is still there — that those voters still come out and support you, if you run on the same things Donald Trump ran on last year. [It’s worth remembering that Trump received more votes in the primaries last year than any other Republican presidential candidate in history.]

A lot of us, in our analyses, made a fundamental mistake. We assumed that because Trump’s approval ratings were so low in the state, there was no way someone like Stewart could have a chance at winning the primary. But what happened tonight is that the 37 percent of Virginia voters who said Trump is doing a good job came out and voted for Cory Stewart in a Republican primary. They’re still a potent force.

The other conservatives — the Republicans who don’t think Trump is doing such a good job — they didn’t come out as much and vote for Ed Gillespie. In the end, it’s partly an enthusiasm thing. There’s far more enthusiasm on the “populist,” “rebellious” side of the party right now then there is among the middle of the party. And that was demonstrated tonight.

Jeff Stein

What parts of Trump’s message did Stewart try to replicate? All the reports I’ve seen have focused on his anti-immigrant positions, his exclusion of minorities.

Quentin Kidd

Yes, he absolutely campaigned on that. He campaigned on protecting Confederate iconography and protecting Confederate monuments. He had people in campaign rallies with Confederate flags.

This isn’t a mistake. This isn’t something that “just happened” that he didn’t encourage. This was part of Corey Stewart’s strategy in a lot of ways, because those voters felt like nobody on either side was speaking for them. Previously, for the most part, they had stopped voting. Or, when they did vote, they usually voted on social conservative issues — like abortion, or prayer in schools, or something like that.

And then last year, Trump attracted them. And Corey Stewart simply chose to play the Trump book over again to attract them again. It was at least enough to get as close as he got.

Jeff Stein

The weird thing about that — and maybe the frightening thing for establishment Republicans — is that Virginia is one of the states where Trump did the worst, in both the primary and the general election. If they’re not in Virginia, that really suggests the moderate Republican base voter — the Jeb Bush voter — just does not exist.

How fair is it to view Gillespie’s surprisingly anemic run as part of that story? And given that Stewart is from Minnesota, could someone with a better campaign running on that message have done even better?

Quentin Kidd

What we used to call “moderate Republicans” in Virginia, we may have to call “Democrats” now. It may very well be the case that a lot of the old country club Republicans — or “Rockefeller Republicans” — don’t associate with the party like they used to, because of Trump. Some of them may even be voting on the Democratic side now.

The reason I say that is because Hillary Clinton won Virginia by 5 points last year over Trump. That shocked a lot of people — not just that she won it, but that she won it handily in an election where every other Southern state went for Trump. It may be because Virginia Republicans have had this ongoing civil war, and that the casualty is the moderate Republican who says, “I can’t take this anymore; I’m going to vote for the Democrat who is business-friendly and talks about economic development.”

That’s what [outgoing Gov.] Terry McAuliffe [D-VA] did. That’s what Northam has done. So that may be what’s going on the Republican side.

Gillespie wanted to run, and tried to run, as a classic ‘80s and ‘90s social conservative, as a George H.W. Bush Republican. Corey Stewart ran as “Donald Trump Jr. with a rebel jacket on.” Those are two completely different political creatures. There’s almost no comparison between the two.

They both would have supported lower taxes and a smaller governmental footprint; beyond that, Corey Stewart probably would have spent a lot of his time using state resources to round up immigrants and pass laws protecting Confederate monuments. Gillespie wouldn’t want anything to do with that stuff unless he was forced to.

Jeff Stein

What kind of challenge does this pose for Gillespie moving forward? How does he recover from this? It seems like trying to reconcile his current image with the 42 percent of his state’s voters who backed Stewart would be impossible.

Quentin Kidd

I think this is the $100 million question. It’s a geometry problem that Gillespie couldn’t find the best mathematicians in the world to solve. How does he go from where he is on the left-right spectrum to move far enough on the right to appeal to the Stewart voters, but also move far enough to the middle to be attractive to the moderate independents who — all things being equal — might want to vote for him?

I don’t think it’s possible for him to stretch himself across that geometric plane. Ed Gillespie’s challenge is, “How do I hug Donald Trump with allowing only the people who like Donald Trump to see me doing it?” I don’t think you can do that.

A look at the Democratic race: Why Perriello lost

Jeff Stein

To go to the Democratic side, we heard a lot in this race about how Perriello was fusing the Sanders wing and the Clinton wing of the party. What went wrong for him today?

Quentin Kidd

The theory didn’t prove to be true that there were thousands and thousands of populist, angry Democrats who would be willing to take a chance on somebody who hadn’t — prior to announcing his campaign for governor in January 2017 — spent more than two years in Virginia elected public life. And who, since then, had been out of the country most of the time.

Perriello’s mistake was that Perriello himself was not enough to win — there needed to be more relationships; there needed to be more connections; he had to know local Democratic committees and local Democratic officials.

At the end of the day, one reason Northam won was because you couldn’t go to any Democratic committee — or any Democratic chair or any elected Democrat in the state — who didn’t know Northam and hadn’t talked to him. At the end of the day, that makes a difference.

Perriello simply didn’t have those kinds of relationships. There was a lot of “energy” behind him, but it really wasn’t enough because Perriello hadn’t been working the Democratic electorate like Northam had been for more than a decade.

Jeff Stein

Part of it seems like the people who show up in a Virginia Democratic primary are those who are probably those who have done so in the past. And those are, by definition, the same people who have already voted Northam into office multiple times.

Quentin Kidd

That’s right. But look: We had twice as many Democrats vote in this election as we did in 2009, when there was also a competitive three-way primary race for governor. So there were a lot more Democrats brought into the electorate on Tuesday.

That’s to Perriello’s credit and to his campaign’s credit. But it’s also to Northam’s credit that he won, because he in some ways became a populist candidate over the course of the campaign.

Thinking back over the campaign tonight, I returned to that one ad by Northam where he calls Donald Trump a “narcissistic maniac”:

In the last week, I’ve had five dozen people at various places where I’m talking comment to that commercial to me. None negatively. And it made me realize that, over the last few months, Northam really has become a progressive on the campaign trail.

He responded to a progressive challenger by becoming a progressive himself. He did what a lot of people weren’t sure he could do, which was to become a progressive.