Gerrymandering is a way of re-configuring a constituency in order to create a disproportionate representation of some cohort of people. Usually this is done by party preference in order to give an advantage to one political party or another. This is more difficult to do in the UK as our electoral boundaries are drawn by an independent electoral commission. There are allegations of gerrymandering here too though. It is suspected that the redistribution of seats when they are reduced from 650 to 600 will give an advantage to the Conservative party as they will reduce the number of seats in London which will impact the number of Labour MPs.
The Practice is more common in the US - in fact they invented the term. The term was coined after a US politician called Elbridge Gerry redrew a district to give himself an advantage. The press reported that it looked like a salamander so the gerrymander was born. In the US system the party that is in power in a state in the year after a census gets to redraw all the districts in the state, for both local and regional elections. This obviously gives them huge power to dictate how they weight the districts. It is also standard in most states to ask for someone's party affiliation when they register to vote. This makes it much easier to gerrymander the districts. Some of these cases of extreme gerrymandering have been challenged in court. The Supreme Court has refused to rule on gerrymandering s o far but there could be more cases before them this year.
Gerrymandering mostly works by 2 methods referred to as cracking and packing. Cracking is where the party affiliation in an area is split into several districts to dilute the party advantage. Packing is where a district is drawn to encompass as many of one party in one district opening up the other districts for the opposing party to steal. Gerrymandering is illegal in the US if it is deemed to have been down to racial reasons but considering the overwhelming support for Democrats amongst black voters in the US there have been discrepancies. Political parties will spend lots of time and money researching the voters in their area, so though we don't have to state a voter affiliation in the UK when we register to vote there is indicative data that political parties will try and find out the political leanings of an area they intend to run in, possibly leading to a false picture of the overall choice of the electorate.