To divide a geographic area into voting districts in such a way as to give an unfair advantage to one party in an election.
(by extension) To draw dividing lines for other types of districts in an unintuitive way to favor a particular group or for other perceived gain.
The superintendent helped gerrymander the school district lines in order to keep the children of the wealthy gated community in the better school all the way across town.