Americans woke up on November 7 having elected a Democratic president, expanded the Democratic majority in the Senate, and preserved the Republican majority in the House.

That’s not what they voted for, though. Most Americans voted for Democratic representation in the House. The votes are still being counted, but as of now it looks as if Democrats have a slight edge in the popular vote for House seats, 49 percent-48.2 percent, according to an analysis by the Washington Post. Still, as the Post‘s Aaron Blake notes, the 233-195 seat majority the GOP will likely end up with represents the GOP’s “second-biggest House majority in 60 years and their third-biggest since the Great Depression.”

So how did Republicans keep their House majority despite more Americans voting for the other party—something that has only happened three times in the last hundred years, according to political analyst Richard Winger? Because they drew the lines.

After Republicans swept into power in state legislatures in 2010, the GOP gerrymandered key states, redrawing House district boundaries to favor Republicans. In Pennsylvania, Democratic candidates received half of the votes in House contests, but Republicans will claim about three-quarters of the congressional seats. The same is true in North Carolina. More than half the voters in that state voted for Democratic representation, yet Republicans will fill about 70 percent of the seats. Democrats drew more votes in Michigan than Republicans, but they’ll take only 5 out of the state’s 14 congressional seats.

“Partisans manipulate the process to their advantage,” says Sundeep Iyer of the Brennan Center, a left-leaning public policy group which has been pushing for redistricting reform to limit partisan gerrymandering. “Not only did redistricting make it easier for Republicans to keep control of Congress this election,” Iyer and his colleague Keesha Gaskins wrote at the Brennan Center’s website, “but it also may have made it easier for them to keep control over the next decade.” (My colleague Nick Baumann warned of exactly this two years ago.)

Republicans point to Illinois and Maryland as examples of Democrats playing the same game, and it is true that Democrats in those states drew maps favorable to their interests. In Maryland, Democrats got 62 percent of the combined vote in House races and 88 percent of the congressional seats; in Illinois they won 54 percent of the vote and about two-thirds of the congressional seats.

“It’s difficult to take all of the politics out of the process,” Iyer admits. But he points to two methods states have used to mitigate partisanship in redistricting. In California, an outside commission was adopted to handle the redistricting process. In Florida, voters approved a ballot measure that alters the state constitution so as to prevent lawmakers from drawing the lines in a way that would “favor or disfavor an incumbent or political party.” If the maps violate the amendments, they can be challenged in state court and possibly declared unconstitutional.

These measures have had limited impact. Iyer pointed to a recent article in ProPublica that showed that in California, “Democrats managed to find a way to manipulate the process even though partisans weren’t overtly involved.” According to ProPublica, California Democrats “surreptitiously enlisted local voters, elected officials, labor unions and community groups to testify in support of configurations that coincided with the party’s interests,” going so far as to invent “a local group to advocate for the Democrats’ map.” And in Florida, Democrats won nearly half the House race votes but will fill about a third of the state’s congressional seats. Believe it or not, Iyer says, that’s actually an improvement.

Redistricting only happens once every 10 years. So Americans may have to learn to live with a Republican House, no matter how they vote.

Graphic production by Jaeah Lee