Kentucky Republicans had a pretty good night on Tuesday. They won five statewide offices, including two they took over from the Democrats: state attorney general and secretary of state.

There was one exception, however, and it’s a big one. GOP Gov. Matt Bevin lost his re-election campaign against Democrat Andy Beshear, the outgoing attorney general.

Beshear’s margin wasn’t big. He appears to have taken about 5,000 more votes than Bevin, out of more than 1.4 million cast. Bevin has refused to concede, referring to unspecific irregularities.

But the result in Kentucky — along with the strong possibility that Democrat John Bel Edwards will win re-election in Louisiana, another red state, on Nov. 16 — shows that even in a highly polarized era, voters are still willing to split their votes when it comes to elections for governor.

“Bevin’s strategy was to make this a national race, make this about Beshear being tied to Nancy Pelosi, Hillary Clinton and Barack Obama and too liberal for the state,” says Dewey Clayton, a political scientist at the University of Louisville. “Beshear played it cool and kept to statewide issues, particularly health care and education.”

Beshear was the ninth Democrat to capture a governorship since the election of President Donald Trump in 2016, including victories in states Trump had carried, such as Kansas, Michigan and Wisconsin. Republicans have picked up no new governorships since Trump took office, although West Virginia Gov. Jim Justice switched to the GOP in 2017.

“Voters think about the executive in their state differently than they do federal races,” says Marshall Cohen, political director of the Democratic Governors Association. “There’s more that voters think about than national politics when they’re voting for governor.”

In Tuesday’s other gubernatorial contest, Mississippi Republican Lt. Gov. Tate Reeves succeeded GOP Gov. Phil Bryant, who was term-limited. Reeves survived a tough primary and competitive runoff and ended up beating Democratic state Attorney General Jim Hood by nearly 6 percentage points.

Although Hood ran well ahead of Clinton’s performance in 2016, Mississippi proved too red a state for him to win. “It revealed what the Republican Party’s strategy is in this state,” says Nathan Shrader, a political scientist at Millsaps College in Jackson, Miss. “They can win and get through these elections, even tighter ones, without appealing outside of the party base.”

Not every state is as red as Mississippi, or as blue as California. Most red states have Republican governors, while most blue states are governed by Democrats.

Still, there are now eight states where Trump won that have Democratic governors. The four Republicans who govern states that Clinton carried — in Maryland, Massachusetts, New Hampshire and Vermont — are consistently ranked among the most popular governors in the nation.

Given the nature of their job — funding schools, building roads and the like — governors tend to be more pragmatic than legislators. Last year, many of the most progressive Democratic candidates for governor lost in states such as Arizona, Florida, Georgia and Maryland. The same held true for Republicans who made support for Trump central to their message in Kansas, Michigan and Pennsylvania.

“Unlike members of Congress, governors are not beholden to their party leaders — Pelosi and Trump — so governor candidates who are better fits for the state are able to win in primaries,” says Shiro Kuriwaki, a doctoral student at Harvard University who published a study showing that South Carolina voters were more likely last year to split votes for governor than for the U.S. Senate.

In 2016, not a single senator was elected to a state that their party didn’t carry for president. There are only 34 U.S. House members, out of 435, who represent districts that voted for the opposite party for president (including just three Republicans).

Fewer than 10 percent of state legislators represent districts their party didn’t carry for president. In fact, Republicans control the legislature in every state that Trump carried in 2016. With their sweep of the Virginia legislature on Tuesday, Democrats now control both chambers in every state Clinton carried, with the exception of Minnesota. (Democrats won the Minnesota House last year, but the state Senate was not up for grabs.)

Legislative majorities have grown bigger over the last decade, meaning one party is not only in control, but firmly in control. Supermajorities are common. Voters in several such states have welcomed governors who can act as a brake on legislatures controlled by the otherwise dominant party.

And most governors are elected outside the presidential year.

“The absence of other high-profile races almost certainly allows for more coverage of the gubernatorial election,” notes Texas Tech University political scientist Joel Sievert, “and makes it more salient for those voters who do participate.”

He notes that voter turnout is lower for gubernatorial elections, compared with the presidential. That gives the minority party more of a fighting chance. Democrat Laura Kelly of Kansas won election with less than 50 percent of the vote last year, as did Republican Charlie Baker of Massachusetts in 2014 (although he won re-election easily last year).

In Kentucky, Beshear took 49.2 percent of the vote, to Bevin’s 48.8 percent.

“In close contests, it does not take that much split-ticket voting in order for the race to tip one way or the other,” Sievert says.

There were instantly arguments among pundits about whether the result in Kentucky can be taken as any kind of bellwether for Trump’s chances next year. Trump carried the state by 30 percentage points in 2016. Bevin essentially sought to make Trump his running mate, referring to him frequently and decrying the impeachment process. Eddie Rispone, Edwards’ Republican opponent in Louisiana, is pursuing a similar strategy and welcomed Trump to the state on Wednesday night.

The simple fact is that voters — sometimes — are willing to vote differently in state races than they do in federal ones. At least when it comes to governors.

Bevin consistently ranked among the least popular governors in the country, making enemies by insulting teachers and legislators alike. “Bevin turned a lot of people off, even Republicans,” says Clayton, the Louisville professor.

Tying himself to Trump may have helped Bevin keep the election as close as it was, says Seth McKee, Sievert’s colleague at Texas Tech. “Nationalizing your contest is a smart diversion when you’re so unpopular in the state.”

Sievert and McKee published a paper last year that found, while elections for governor have become more nationalized in recent years, voters are still more likely to break party ranks for them than in Senate contests.

“When I look at governor races, I think they’ll always have that wiggle room for people to split their tickets,” McKee says. “There are real issues that face states. What they do in a state is often very detached from what happens in national politics.”