When the polls closed last night in Mississippi, the bitter primary between Sen. Thad Cochran (R) and state Sen. Chris McDaniel (R) wasn’t quite over: A third candidate, realtor Tom Carey (R), scored 1.6 percent of the vote, just barely enough to deny both Cochran and McDaniel a majority of the vote.

Mississippi is one of a handful of states, mostly in the South, that requires the top vote-getters in a primary election to reach a specific threshold in order to avoid a runoff.

Those runoffs are low-turnout affairs, costly for cash-strapped state elections boards and draining for candidates who have to spend another month or two campaigning for the votes of a narrow segment of the electorate. These days, given Republican domination of the South, they can serve to elect the most conservative  possible candidates.

But when primary and runoff elections were first created, around the beginning of the 20th Century, Republicans were an afterthought. The runoff system is a vestige of a time when white Democrats controlled Southern politics, and manipulated election rules to make sure they stayed in power.

“They trace their lineage back to an era when there was only one party in politics,” said Charles Bullock, a political scientist at the University of Georgia who wrote a definitive history of runoff elections in 1992. “Back in the day when the South was one-party Democratic, the runoff was often the determinative election. So you often had more people participating in the runoff than in the original primary.”

Southern states started implementing runoff systems in the late 19th and early 20th Century, when state parties used to run primary elections. Democrats controlled the South then; when a constitutional amendment allowed for the direct election of senators in 1914, Democrats held every Senate seat in the South. So the runoff system, first adopted by South Carolina in the late 1800s in order to exert more control over gubernatorial primaries, allowed party bosses to select nominees.

At the time, literacy tests, poll taxes and other hurdles to voting kept African Americans away from the ballot box. And because the Republican Party was such a small percentage of the overall electorate in the South, general elections mattered far less than primaries; the winner of a primary was virtually guaranteed to win the general election.

“The Democratic Party had a monopoly on politics in the region,” said Merle Black, a political scientist at Emory University. “After blacks were eliminated as voters in the South, that ended the Republican Party.”

The African American voters who did remain on the voter rolls were energized in the years following the Civil War, said Cal Jillson, a professor at Southern Methodist University in Texas. Democrats, who used to nominate candidates in conventions, began to move to primaries and runoffs as a way to unite the factions that split the party, and thus to head into a general election with an advantage against Republicans.

The major challenge, in several states, came from the Populist Party, which held similar views to Democrats on race, and therefore was acceptable to white voters, but served as an outlet for voters unhappy with the Democratic Party, said Morgan Kousser, an expert in Southern politics at California Institute of Technology.

“The primaries were an attempt both to enlarge the group that awarded the nomination, but also to provide an opportunity for whites if they factionalized to come back during a runoff,” Jillson said.

In at least one state, Arkansas, runoff elections were established in an effort to marginalize a different faction of the Democratic Party: The Ku Klux Klan. Arkansas implemented runoff voting in the 1930s specifically in order to keep Klan members from winning party primaries with small pluralities, Bullock said.

But most states established the runoff to maintain white Democratic domination of local politics. Letters and speeches that survive from the period show race was very much on the minds of those Democrats who advocated the primary-runoff process. “People had no misgivings about stating their real intentions and stating them in racial terms,” Jillson said. “The stuff that no longer passes Anglo lips, they were more than comfortable in saying.”

Today, Mississippi is one of seven states — Alabama, Arkansas, Georgia, Oklahoma, South Carolina and Texas are the other six — that require a runoff election if no candidate receives an absolute majority in a primary election. North Carolina candidates must hit 40 percent of the vote to avoid a runoff.

Louisiana has a unique system: Candidates from all parties compete in the November general election. If no one reaches 50 percent, the top two vote-getters advance to a December runoff, regardless of party.

(Two non-Southern states have runoff rules that almost never matter. In South Dakota, candidates for U.S. Senate, U.S. representative and governor must compete in a runoff if no one reaches 35 percent of the vote. In Vermont, a runoff is ordered if two candidates finish with the same number of votes.)

States began to take over primary elections systems from party committees in the 1950s and 1960s, and codifying runoff election systems into state law.

Now, though, the South has flipped. Republicans control nearly as many seats as Democrats once did, and runoff systems are no longer a tool to disenfranchise certain minority voters. Instead, runoffs in Republican primaries tend to reward candidates who best fit the smaller, more committed, more ideological electorate that shows up to vote.

Several senators have benefited from runoff elections. If candidates who won a bare plurality in Republican primaries had not had to face a runoff, former Sen. Jim DeMint (R-S.C.) would never have been elected, either to his House seat or later to a Senate seat; in 2004, DeMint finished 10 points behind former Gov. David Beasley, then beat Beasley by 18 points in the subsequent runoff. Sens. Jeff Sessions (R-Ala.) and Ted Cruz (R-Texas) both required runoff elections to win their seats.