Congressional gerrymandering is most extreme in Michigan, Pennsylvania and North Carolina, according to the Princeton Gerrymandering Project. For state legislatures, add Wisconsin to the list.

“In a certain sense, redistricting is the spoils of war,” said Samuel Wang, a professor of neuroscience and molecular biology at Princeton, who runs the Princeton project. “It’s legitimate as long as it’s a small advantage. But now we’ve seen such a big distortion of the process.”

One reason is the emergence of mapping software that can draw precise lines to maximize any desired outcome. Another is that the Republicans outsmarted the Democrats in the 2010 elections. The Republican Party focused on 18 states in which control of the state legislature was close. Republicans picked up 22 new state legislative chambers just in time for the 2011 redistricting — and were able to draw the districts for 193 seats in the House of Representatives. The Democrats controlled redistricting for 44. Control of the rest was either split between the parties or nonpartisan.

That’s why in Virginia’s state government elections two months ago, Democrats didn’t get to control the Legislature even though they won the statewide popular vote by nine points, a landslide. It’s why Michigan Republicans got 16 more seats in their State Legislature than Democrats in 2016, even though the total vote in the state legislative races split down the middle. It’s why North Carolina’s Republican congressional candidates won 10 out of 13 seats with just 53 percent of the total vote. Democrats also gerrymandered in some states where they got the chance, Maryland being the starkest example. They just didn’t have many chances.

States will redraw the lines anew in 2021. This time, the Democrats aren’t napping. Former Attorney General Eric Holder leads the National Democratic Redistricting Committee, which seeks independent redistricting commissions but also wants to elect Democrats.

Pennsylvania’s judgment is the latest in a series this month. One group of federal judges ruled that North Carolina’s congressional districts had been unconstitutionally gerrymandered for partisan advantage — the first-ever such ruling. A day later, a different panel found the opposite in Pennsylvania, but that was before the new judgment came down Monday from the state Supreme Court. Other state courts are dealing with lawsuits as well, and the United States Supreme Court has heard arguments on gerrymandering cases from Wisconsin and Maryland.

Then there are nonpartisan citizen campaigns that have nothing to do with Holder’s group. Michigan’s is the furthest along, but citizens are also organizing for ballot initiatives in Ohio, Missouri, Utah, Colorado and South Dakota. In Pennsylvania and Virginia, grass-roots groups sprang up to persuade legislators to establish independent commissions. Other gerrymandered states are still waiting for their Katie Fahey.