Partisan polarization makes gerrymandering a lot easier. But what does that phrase, “partisan polarization,” mean? Simply put, the overwhelming majority of voters typically stick with the same party from one election to the next. They also mostly vote for the same party for president and Congress. Indeed, as the above graph demonstrates, presidential and congressional elections results were extremely correlated with each other in 2012, which is to say that votes in one race overwhelmingly predict votes in the other. In fact, ticket-splitting reached a roughly nine-decade low four years ago, but even if more voters split their tickets this year thanks to Donald Trump, the vast majority will still favor the same party for both offices.

This partisan predictability lets mapmakers use past results for other races like president or governor in a given district to gauge how favorable it will be toward either party on average in future congressional elections, regardless of which candidates actually run. Cartographers typically have two goals when drawing a partisan gerrymander: They want their party to win as many seats as possible, and they want to make all those seats they win secure for their party and invulnerable to future challenges. A party doesn’t need to win every seat in a legislature so long as it can count on having a comfortable majority.

Mapmakers have two classic strategies for achieving those goals when drawing an effective gerrymander: packing and cracking. With packing, line-drawers make a minority of districts as favorable as possible to the other party, quarantining as many hostile partisans as they can into as few districts as they can. They then spread out their own party’s voters more efficiently in the majority of seats, making sure to give the friendly party a decisive advantage—but not one so great that their own voters become redundant like in those packed seats for the opposite party.

With cracking, cartographers dilute voters who would otherwise, if drawn together, yield a district that would support the opposing party. Instead, these voters are spread between multiple districts, in concentrations thin enough to ensure that the mapmaker’s preferred party will win those seats. Those wielding the redistricting pen can likewise unpack a district that’s too heavily favorable to their own party, using those excess friendly partisans to flip a neighboring district or two while still keeping the unpacked district secure. We can see both of these principles at play in the Republican-drawn congressional map below.

Following the 2010 census, Republicans crammed as many Democrats as they could into just three districts, taking in parts of dark-blue Charlotte, Durham, Greensboro, Raleigh, and other cities, along with black voters in the rural northeast, almost all of whom vote Democratic. When Republicans couldn’t pack in Democrats from other liberal cities like Asheville in western North Carolina or Wilmington in the southeast, they cracked them between two seats containing other heavily Republican turf.

With surgical precision, Republicans spread out their own voters almost perfectly evenly among the other 10 districts, making sure that none would be either blue enough to be vulnerable or too heavily tilted to the right such that Republican votes would “go to waste.” Although Mitt Romney only carried North Carolina with 51 percent of the two-party-only vote, he won 10 districts with between 56 percent and 62 percent. On the other hand, Romney won less than 30 percent in all three Democratic vote-sinks.

This map worked like a well-oiled machine in 2014, comfortably electing 10 Republicans and three Democrats, while it sent nine Republicans and four Democrats to Congress in 2012, even though Democratic candidates won more votes statewide than Republicans did that year. Democrats won the Romney-voting 7th District in 2012 by just several hundred votes thanks to a particularly entrenched moderate Democratic incumbent, but lost it handily in 2014 when then-Rep. Mike McIntyre retired to avoid a likely defeat.

A federal court struck down this map as an unconstitutional racial gerrymander early in 2016, but thus far the Supreme Court has refused to strike down maps drawn to maximize partisan advantage. Knowing this, Republicans swiftly replaced the stricken map with a new partisan gerrymander that is only modestly less powerful. This newer map will likely continue to elect 10 Republicans and three Democrats, just as the previous map did in 2014.

By contrast, had Democrats had the chance to draw the map of their dreams back in 2011, it could have been nearly as effective the other way. The map below offers one such hypothetical example:

Look at all of that blue! This hypothetical plan gives Democrats eight safe districts that would have voted for Obama with 56 to 60 percent of the vote, while packing Republicans into just four seats, all of which would have favored Romney with between 65 and 71 percent. It’s not quite as effective as the GOP’s actual gerrymander, since the western 11th District mirrors the partisanship of North Carolina overall (it would have given 51 percent to Romney). However, it would likely have been highly secure for someone like Heath Shuler, a Blue Dog who easily won a much redder district even in the 2010 GOP wave and only retired in 2012 after Republicans drew his already light-red district to be far more conservative.

In total, this map would likely consistently elect nine Democrats and four Republicans, so long as Shuler continued to run, but even if he didn’t, Democrats would have had no worse than a 50-50 chance to carry his seat. So even in the worst-case scenario, Democrats would still have an eight-to-five advantage.

But it doesn’t have to be this way, as the hypothetical nonpartisan map below illustrates:

Five districts here favor Democrats and five favor Republicans, while three districts could potentially go for either party in a typical election year. Those three swing districts all voted for Romney by modest margins, but the 2nd and 7th districts were more favorable toward Democrats downballot in races like governor or senator, meaning Democrats running for the House in those seats would have a good chance at winning.

Practically speaking, in 2012, Democrats likely would have won all five blue districts, plus the 7th and 11th, thanks to the strengths of McIntyre and Shuler, while the 2nd District and all five red districts would have likely gone Republican that year. That would have given Democrats a bare 7-to-6 majority, very closely reflecting North Carolina’s evenly divided nature.

Some analysts contend that gerrymandering simply doesn’t matter all that much, and that Republicans’ advantage in congressional and legislative redistricting nationwide stems from the inefficient geographic distribution of Democratic voters. As this story goes, Democrats are overwhelmingly packed into inner cities that vote monolithically blue, while Republicans are more efficiently distributed among suburban and rural areas that aren’t quite so equivalently dark red. This hypothesis holds that drawing compact nonpartisan districts will naturally give Republicans many excess seats.

However, while geography is modestly biased against Democrats, this penalty pales in comparison to the impact of gerrymandering. Nationwide, Republicans were able to draw 55 percent of congressional districts in their favor following the last census while Democrats did the same with just 10 percent. Consequently, Romney prevailed in 224 of the districts in use for the 2016 elections, while Obama carried just 211, even though the president won the national popular vote by nearly 4 percent in 2012.

By contrast, in a series of nonpartisan congressional maps we drew for every state to estimate the impact of gerrymandering, we determined that Obama would have carried 239 of these districts to Romney’s 196. As a result, we found that gerrymandering likely cost Democrats a net 25 seats and the majority in 2012, with a similar outcome possible in 2016. This substantial distortion exists in myriad state legislatures across the country as well, even going so far as to give Republicans majorities in several states that Obama won.

But closely divided North Carolina offers the clearest example of just how consequential control over the redistricting process can be. No nonpartisan districts can be perfect—redistricting always involves making tradeoffs. However, ending partisan gerrymandering could go a long way toward making our congressional and legislative elections more accurately represent the partisan intentions of the overall electorate—or in other words, simply making them more democratic.