Gerrymandering is a practice used by political parties to gain advantage in elections. It involves manipulating the boundaries of electoral districts in order to give one party an unfair advantage. This can be done by creating districts that are packed with supporters of one party, making it hard for them to lose, or by creating districts that are split evenly across two parties, making it hard for either party to win. Political parties engage in gerrymandering because it gives them the opportunity to gain a larger number of seats in legislatures and thus increase their chances of winning elections.