A special election in New York on April 24 could tip the state Senate back to the Democrats — putting the party in full control of state government.

But a lot has to happen for New York to turn truly blue, and the outcome depends as much on which voters turn out for an off-year local race as it does on backroom Albany dealmaking. Thanks to a single rogue Democratic senator who votes with Republicans, a numerical majority for Democrats still might not translate into the ability to pass Democratic bills — unless, after the election, he decides to rejoin the caucus.

Here’s what to know about a special election that could flip New York’s legislature — and intensify the pressure on Gov. Andrew Cuomo to add to his progressive résumé amid a surprising primary challenge from Cynthia Nixon.

Only one race really matters: the 37th District

Cuomo called the April 24 special elections to fill 11 vacancies in the state Assembly and Senate, which opened up after lawmakers won other offices last year. Nine Assembly seats and two Senate districts are in play.

New York’s state Assembly, the lower chamber, is overwhelmingly Democratic, and, no matter what, will remain so after April 24. The real drama is in the 63-seat state Senate, where Republicans now hold a slim majority.

Of the two vacancies, one is in the 32nd District, which covers a large swath of the Bronx and heavily leans Democratic. Luis Sepulveda, an Assembly member from the Bronx, is practically guaranteed to win.

That puts all attention on the 37th District, which covers part of Westchester County, suburbs north of New York City, that includes a mix of extremely wealthy and more middle-class communities. The seat opened up after Democratic Sen. George Latimer ousted the GOP incumbent as Westchester County executive last fall.

Democrats outnumber Republicans 2 to 1 in the district, but the margin isn’t as safe as it sounds. The GOP has targeted the district as a toss-up based on recent elections, so much of this will come down to turnout on a random Tuesday in April. It’s a microcosm of the type of swing suburban district that Democrats are looking to pick off nationally in 2018.

The race pits Democrat Shelley Mayer, a state Assembly member, against Republican Julie Killian, a member of a local city council who ran unsuccessfully for state Senate in 2016 against the incumbent Latimer. (Killian lost by more than 10 points.)

Local issues such as the opioid crisis have dominated the race. Corruption is another, and though both candidates have vowed to clean up Albany, Killian has tried to paint Mayer as an insider, part of the state Capitol swamp. Mayer is a progressive, but Killian isn’t exactly a Trumpian candidate — she’s a true moderate who supports funding environmental programs and gun control measures.

Given the district trends in previous elections, combined with the national mood, it seems likely Mayer has the edge. “Special elections are weird, so it’s really going to come down to who turns out,” Craig Burnett, a political science professor at Hofstra University, said, “but I suspect that the Democrats will still win.”

Even so, Burnett added, the election doesn’t matter all that much because the legislative session is almost over, ending in mid-June. “In terms of actually governing, it’s not going to have a huge effect, but it does potentially build up for what happens in the fall, and whether or not there’s going to be a several-seat majority,” Burnett said. “This will bestow upon whoever wins that incumbency advantage — at least for a short period of time.”

But there’s a catch. A Democratic victory in the 37th might not be enough to actually give the Democrats full control of the Senate — all thanks to Albany’s bizarre brand of politics.

Simcha Felder: the rogue Democrat spoiling the party’s majority

If Democrats win Tuesday, they will have a numerical majority of 32 to 31. But they still might not be in control of the chamber. That’s because of one current Democratic state senator, Simcha Felder, who represents a more conservative, largely Orthodox Jewish neighborhood in Brooklyn. Felder was elected as a Democrat but caucuses with the Republicans.

Felder is one of several rogue Democrats that for years played this weird game of caucusing with the GOP, leaving Democrats in the minority and stymieing their ability to bring legislation to the floor. A recent deal with breakaway Democrats in the Independent Democratic Conference — brokered with help from Cuomo — brought most of the runaways back into the mainline fold. All of them, that is, except Felder.

Felder said he would wait until after the April 24 election to make his decision. If the GOP candidate Killian wins, he will surely stay in his strange marriage with the state Republicans. If Mayer wins, there are signs Felder will rejoin his Democratic colleagues.

Doug Muzzio, professor of political science at Baruch College, described Felder as a “wild card.” He also has all the leverage. “He’s going to come back, but he’s got to make a good deal, and he’s got the power to do so,” Muzzio said.

Felder may have played the spoiler in the past, but Democrats will likely welcome him back without question to regain power to bring legislation to the floor. What’s more, whether the Democrats pull off this special election or not, they are in a favorable position to possibly take full control in November, when the state Senate is up for reelection. Their majority will be slim — but Felder doesn’t want to be on the outside looking in if that happens.

“Now that it’s looking like Democrats are going to take control in November, regardless,” Burnett said. “So I think, long term, that the IDC made the calculation they would rather be on the inside than not, and Felder might make that calculation because being in the minority is not a whole lot fun.”

The Democrats still face one potential obstacle even if Felder returns. There’s a Senate rule that requires 38 votes to change Senate leadership midsession, though the Democrats could challenge that in court if they win on Tuesday.

But if all these variables align for Democrats, Cuomo will be governor with an actual Democratic legislature. The Independent Democratic Conference formed shortly after 2010, and the governor’s critics said the Republican-controlled state Senate gave him cover to govern down the middle. But a surprising challenge from the left by Cynthia Nixon in the gubernatorial primary has put Cuomo on edge, and he’s trying to bolster his liberal credentials.

A Democratic state Senate means progressive legislation can make it to the floor and potentially to the governor’s desk — at least in the barely two months left in New York state’s legislative calendar. Then it’s time to do this all over again in November.