Over time, more protections against rampant party manipulation have been built. The first layer of defense against politicians creating totally incoherent maps and gaming the republican system is found in the Equal Protection clause of the Fourteenth Amendment. As outlined in the Supreme Court ruling in the 1962 Baker v. Carr case, states have to redistrict every ten years in a way that keeps up with population shifts and keeps every district roughly equal in population. That’s called the “one person, one vote” rule.

Layered over that basic foundation are the laws that have dictated just how to truly guarantee equal protection under the law. Chief among those is the Voting Rights Act of 1965, which both prohibits the use of maps to dilute minority voting power and also dictates certain conditions under which creating special districts to protect them is required. On top of the VRA are further layers of court interpretations, tests, and principles—including the compactness and contiguity of districts and how well they preserve special communities of interest—that guide court decisions.

Under those rules, politicians are free to some extent to use redistricting for partisan advantage, sometimes bending or breaking the rules in the process. In practice, that means that national party infrastructures build coordinated redistricting efforts across states, during which they pour money into winning states each decade and then bring small armies of lawyers, consultants, and cartographers to create the new maps, which they then shepherd through rounds of public scrutiny, legislative battles, and then the inevitable court challenges and legal reviews that come up for any remotely controversial maps.

The incentive to gerrymander—or create irregular and incoherent districts that may or may not be legal—is strong. Although the Supreme Court has held that using redistricting to create partisan advantage can be unconstitutional, it also holds that some level of partisan gerrymandering is acceptable, and has so far declined to rule on where the line is, or if it can even determine a line at all. That means that as long as they can avoid the ire of the courts, politicians can use maps to corral opposing party’s voters in a few districts and create unbreakable party fiefdoms out of the other districts. The main limitations to gerrymandering outside of the courts have historically been the other party’s ability to fight gerrymanders (or create their own when in power) and the lack of precision in map-making capabilities.

According to John Ryder, the former general counsel of the Republican National Committee and the RNC Redistricting Committee chair during the 2010 redistricting cycle, “for the two parties, it’s both offense and defense. Parties try to try to maximize their opportunities and minimize their losses.” Ryder is a titan within the Republican redistricting brain trust, and has helped guide the party’s efforts for decades now. He cut his teeth challenging Democratic state maps in his native Tennessee, long a hotbed of gerrymandering challenges and the place where the foundational Baker v. Carr case created the modern gerrymandering game.