Suppose you have a state with five districts and the state is 60% Brown Party and 40% Black Party.
If you draw five districts that are each 60% Brown, you get five Brown representatives even though 40% of the state is Black.
If you draw districts along party lines then you get three Brown representatives and two Black representatives, but the districts are totally uncompetitive and the representatives from both parties can steamroll everybody because none of them ever have any chance of losing their district no matter what they do.
There are also several other options, and most of those are even worse.