WASHINGTON ― Redistricting is far from the sexiest thing on the Supreme Court’s docket, but the way the justices shape rules around it could mean life or death for the politics of a state or its parties.

For two hours on Monday, the high court struggled with two related cases ― one from Virginia and another from North Carolina ― touching on what’s likely the toughest and most controversial area of redistricting law: racial gerrymandering, or the practice of taking race into account when redrawing state legislative and congressional maps.

The Constitution’s guarantee of equal protection places stringent limits on how much states may consider race when updating district lines. But there’s also the Voting Rights Act of 1965, which requires states to use race to some degree when drawing legislative maps, so as to ensure that minority voters have an opportunity to elect candidates of their choice.

It’s a Catch-22, and the Supreme Court for decades has grappled with creating tests that provide just the right balance for state legislatures to follow. The last time the court tried to do that, in a 2014 Alabama case, the justices split sharply along ideological lines, and even that decision’s author, Justice Stephen Breyer, suggested Monday there may be more work to be done in this area.

“That is the decision of the court. I had thought that having done that, there would be lots of lower courts that would rely on that decision,” Breyer said about his own ruling, which noted that states ought to have a “strong basis in evidence” when factoring race in redistricting decisions. “Is it a good idea now suddenly to change and go to some different test?”

The court’s apparent confusion is complicated further when states that are sued for engaging in aggressive racial gerrymandering ― for example, packing black and Latino voters in specific districts in such a way that it dilutes their voting power elsewhere ― say they’re being partisan about the process, not racially discriminatory.

Noting that race is “the evil the Constitution is intended to avoid,” Justice Sonia Sotomayor crystallized the difficulty of separating racial considerations from mere political ones in the context of redistricting.

“See, your way is to say that state legislatures go out and always say it’s politics, because it’s real easy to say politics, even though there’s a lot of direct evidence that it really was race,” Sotomayor said to Paul Clement, the lawyer representing both states. “The issue is, are the state legislators prohibited from using race predominantly? And if they are and the proof is they have, then they should go back to the drawing board and do it without it.”

The Virginia case asks the justices to determine whether the state’s 2011 House of Delegates map, which contains 12 legislative districts where African-Americans make up 55 percent of the voting-age population, is unconstitutional because it deliberately packs too many black voters in those districts, reducing their clout elsewhere.

“Isn’t there something a bit strange about this kind of rule?” Justice Elena Kagan asked, referring to the 55-percent cutoff. “And it’s not to say that this kind of rule is the end all and be all ... It sort of defies belief you could pick a number and say that applies with respect to every majority-minority district.”

More than 20 years ago, the Supreme Court ruled that if a state legislature used race as the “predominant” factor in its redistricting decisions, then its plans violate the Constitution. But here Virginia insists that race was merely a factor motivating what was otherwise a “bipartisan success story” that allowed minority voters to pick candidates of their choosing.

“The reason that, in this area uniquely, the court allows race to be considered is in part because the Voting Rights Act makes the consideration of race absolutely necessary,” Clement said.

Justice Samuel Alito acknowledged that reconciling these principles is “very, very complicated,” signaling that no matter how the court rules ― and what legislatures do in response to whatever the new rules are ― it will undoubtedly be “an invitation for litigation” in this area.

The other case, from North Carolina, finds the embattled state ― which just Monday saw Gov. Pat McCrory (R) concede the election ― asking the Supreme Court to uphold two congressional districts that are very familiar to the justices: Congressional District 1 and Congressional District 12.

Legal Brief in McCrory v Harris The snake-like shape of Congressional District 12, whose boundaries have been the subject of several Supreme Court disputes.

Both maps have landed before the justices in prior disputes, and after the 2010 census ― and the election of Barack Obama in 2008 ― the North Carolina legislature set out to redraw them with an eye toward putting a higher percentage of minority voters in those districts.

Democratic super-lawyer Marc Elias ― who has been busy in recent months with voter suppression lawsuits, voter ID challenges and post-election recount monitoring ― said this was precisely the kind of “political” move that the Constitution doesn’t allow.

“The harm is in using race as the predominant factor,” he told the court Monday. “There is no constitutional right to political gerrymandering that has to be protected. What has to be protected is voters’ rights.”

Because the line between race and politics is a fine one ― and the Supreme Court has yet to define it with precision ― both the Virginia and the North Carolina cases are likely headed for a photographic finish. And to get there, the court may very well try to strike a balance between respecting voting rights and giving states their due deference.

“It’s not just the states’ interest,” Breyer said. “It’s the constitutional interest in seeing that minorities have representation in reality in the legislatures.”