Geography helped in some states. Democratic voters are more likely to live in densely populated urban areas, making it easier to pack them into fewer districts.
The first payoff came in 2012, when Republicans kept control of the House despite a Democratic wave that swept President Barack Obama to a second term. The next payoff is likely to come this fall when candidates once again compete in House districts drawn by Republican legislators in key states.
Gerrymandering has a long history in the United States, pursued enthusiastically by both Democrats and Republicans. But the GOP's success at it this decade has been historic: In 2012, Republicans maintained a 33-seat majority in the House, even though GOP candidates as a group got 1.4 million fewer votes than their Democratic opponents.
It was only the second time since World War II that the party receiving the most votes failed to win a majority of House seats, according to statistics compiled by the House Clerk. Democrats gained eight seats but were still a minority.
"The fact that Republicans controlled redistricting (after 2010) meant that they were able to build up a wall, stopping a lot of the tide from running out," said Justin Levitt, a law professor and redistricting expert at Loyola Law School in Los Angeles. "They were able to shore up a lot of the districts that had been won by, in many cases, tea party freshmen or other Republican freshmen."
The Republicans' advantage will fade as the decade wears on and the population changes. In the meantime, lopsided House districts are having a direct impact on the ability of Congress to tackle tough issues. House districts are drawn so that Democrats and Republicans often represent very different groups of people with different views on divisive issues. That can make it hard to find common ground.
Democrats control the White House and the Senate, though control of the Senate will be up for grabs in November. Republicans control the House, giving them powerful leverage to block Obama's second-term agenda.
How did Republicans gain their historic advantage? It all started with the party's sweeping victories in 2010 and a plan called REDMAP.
The 2010 election was a disaster for Democrats. Voters were angry over bank bailouts, the poor economy, ballooning budget deficits and Obama's new health law, which had just passed Congress without a single Republican vote. All these issues fueled the rise of conservative tea party groups that backed Republican candidates up and down the ballot.
Obama called the election "a shellacking."
Republicans picked up 63 seats to win control of the House. They also gained seats in the Senate, though Democrats kept their majority.
Perhaps more important, Republicans won control of state legislatures in key states, giving the party the edge that is still paying dividends.
Every 10 years following the census, states redraw the boundaries of House districts to account for population changes. Some states gain seats and others lose them, so the overall total remains 435. In most states, the legislature and the governor draw up the new districts, which is why political parties pay special attention to elections at the start of each decade.
"I think Democrats made a terrible mistake. They did not put nearly enough attention or resources into legislative races at the state level," said Matt Bennett, a former aide to President Bill Clinton. "A bunch of these legislatures slipped by very narrow margins, and some of them flipped for the first time since Reconstruction in the South."
For Republicans, it was a combination of luck and planning. The political winds were in their favor, but they also had been plotting for years to take full advantage of redistricting.