In Pennsylvania, only democrats are allowed to gerrymander districts for their benefit.
When a Republican legislature (voted in by the people) gerrymander districts, the democrat controlled State Supreme Court orders it unconstitutional and submits it’s own districts (that of course, favor democrats).
This is how it works in Pennsylvania. The voters be damned.
Here is a link to the discussion of the SC gerrymandering case at Althouse blog (Anne Althouse is a retired constitutional law professor).
Most of the comments are spot on and rather amusing.
https://althouse.blogspot.com/2024/05/writing-for-majority-justice-samuel.html