Extreme candidates for the House of Representatives do worse than moderates because they mobilize the opposing party to turn out to vote, according to new research from Andrew Hall and Daniel Thompson of Stanford University.

Political scientists and campaign experts have been divided for decades about whether candidates are successful when they win over swing voters — those who aren’t loyal to any party — or when they encourage members of their own party to show up at the polls. The research suggests that when it comes to ideologically extreme candidates, the deciding factor might be the other party’s turnout.

To measure political ideology, the researchers looked at each candidate’s campaign contributions. So, a candidate with donors who had previously given to far-left or far-right politicians would be rated as more extreme than a candidate with donors who gave to moderates.

Then the researchers considered elections for the House from 2006 to 2014 in which an extreme candidate and a moderate faced off in the primary. But, because districts where extreme candidates win handily are probably very different from districts where moderates win with ease, they examined only close races (in which the winner had less than a 10 percent margin of victory).

They found that when the more extreme candidate won the primary, the party did far worse in the general election: Its share of votes fell by between 7 and 15 percentage points.

In addition, a greater proportion of the people who turned out to vote were members of the opposite party. So, say a more extreme Democrat barely defeats a moderate in the primary. The research suggests that the Republican share of voters who turn out would be 5 to 10 percentage points greater than if the moderate had been nominated — and that the Democrats are much more likely to lose because they nominated the more extreme candidate.

If the extreme candidates were losing because they scared off swing voters, turnout wouldn’t be expected to change. So the research suggests that when an extreme candidate is nominated, voters from the other party show up to vote at a higher rate.

Look at the 2010 Democratic primary race in Arkansas’s 2nd Congressional District, where the more extreme Joyce Elliott ran against the relative moderate Robbie Wills. During the campaign, Wills sent out mailers explicitly calling Elliott an extremist, according to Hall. Despite that, Elliott won the nomination, but then lost the general election in a landslide. The two-party turnout was 59 percent Republican.

The pattern holds across party lines. Consider the 2012 Republican primary in Minnesota’s 1st District. The moderate, Mike Parry, lost to Allen Quist, who had campaigned against same-sex marriage and called for mandatory AIDS testing in order to receive a marriage license. Quist lost the general election. Fully 66 percent of the two-party turnout went to the Democrats.

Here’s a simple way to explain it: If you’re a die-hard Democratic voter, you don’t lose that much if a moderate Democrat wins the election. But if you’re a moderate Republican voter, you lose a lot if the extreme Democrat wins, and so you’re more likely to turn up to vote against them if they’re nominated. It’s counterintuitive, but the Republicans might care more than the Democrats about how extreme the Democratic nominee is.

The research considered only House races, so it can’t be used to explain the recent presidential election. Furthermore, “it's hard to articulate what Trump's ideology would be if he had one,” Hall said, so the study doesn’t apply to him. If you look at the 2016 congressional elections, it was “business as usual,” he added.

But Hall thinks the study suggests that for the upcoming midterm elections, the Democrats should look to recruit more moderate candidates if they want to take back the House and Senate. 

And even though extremism might not be effective in winning votes in swing districts, it can still shape the political conversation. Take the tea party movement. Its candidates lost seats, but they pushed its agenda forward, Hall said. Especially in swing districts.

“Seat by seat, is [extremism] effective? Almost certainly not,” Hall said. “Is it effective in some grander political strategy? No one knows.”