First off imagine an ostensibly completely fair system where each district was somehow made up of a random person within a state. Contrary to intuition, you would have actually just created the most gerrymandered system imaginable, where a party with only 51% of approval within a state would end up with 100% of representative seats, winning each and every district by 51%.
So counter-intuitively you do intentionally want to pack voters of a similar type into certain districts to create a fair system, which leads to all sorts of weird things, including the "solution"! It turns out the most fair system is to intentionally gerrymander! If you let each party with at least e.g. 1% of the vote take their turn creating an intentionally gerrymandered district for themselves (you can only 'district' your own voters), the self-maximizing solution is to create a 51% district in your favor. But if you mathematically work this out, this actually creates a perfectly fair (as close as possible to x% voters = x% of seats) result in the end! I can give an example if you find this unbelievable.
So all the rhetoric about trying to solve gerrymandering is mostly just theater and gesturing. The solution I gave is not some huge secret, even if most people are not aware of it. The only argument against it is that x% voters = x% seats is not desirable, but I think that's a rather fringe view. Geographic stuff doesn't mean what it used to, especially when there's millions of voters per district.