| It doesn't stop|
at the water's edge
A "gerrymander" is a voting district in first past the post electoral systems which is geographically nonsensical, created to tweak the representation of various groups in a legislative body. It is named for then-governor of Massachusetts Elbridge Gerry and the salamander, and was coined for a state senate district which crawled all the way around the port city of Boston from the shore to the south to the shore to the north, and was illustrated in a political cartoon of the day as an actual salamander.
Around the world
The biggest and most overlooked factor that has increased partisanship is gerrymandering. Current rules forbid the Republican National Committee from posting "agents, servants, and employees" at polling sites, but not the Democrats. The RNC is banned because in 1982 they were fucking with voters based upon their race. They targeted a lot of black and Latino voters and had them removed from the voter rolls, despite them being eligible to vote. Typically, the more people who vote, the better the Democrats do in elections.
In the United States, each state is required to reapportion their Congressional districts following each decennial census. The party in power in each state tries its best to increase its representation by this method, even to the level of using computer programs to parse the exact boundaries of the districts. In the 2000 census, it was discovered that the dominant party of a state could completely control the districts using computerized gerrymandering. This means that politicians are more beholden to the far left and far right, because the middle has been carved out and given to the other side, or simply marginalized. Some states, however, have mandated letting a computer program do the job "honestly", taking the politics out of the task. Also California now does its redistricting via an independent commission composed of 5 Democrats, 5 Republicans, and 4 Other (minor party, independents, etc.).
State legislatures tend to approve district boundaries that benefit incumbents, sticking their opponents into safe seats and cramming all of their supporters into a small number of districts. This allows the incumbent to spread their supporters over a larger number of districts. Sometimes a majority party punishes the minority party by redistricting two minority incumbents into the same district, forcing them to run against each other in a primary. Another strategy is to stuff as many minority party voters as possible into the fewest possible districts. The current US House of Representatives reflects pro-GOP gerrymandering by state legislatures, as it has a Republican majority despite the fact that Democratic candidates got more votes overall.
Historically, gerrymandering was used in the US to limit African American representation. More recently, African American advocacy groups supported gerrymandering as a means to increase black representation, but the US Supreme Court ruled in Shaw v. Reno that district lines could not be drawn on the basis of race. Because "pandering" to white males is seen as the default, it's only considered "pandering" if you're going out of your way to appease a different group.
Gerrymandering was also commonplace in Northern Ireland prior to the abolition of the old Stormont Parliament in 1972, with the intention of restricting Roman Catholic representation. This in addition to Sinn Fein abstentionism made the Parliament a practically all Protestant-Unionist body and many Catholics actually welcomed "direct rule" from London at first.
It is claimed that the current constituency boundaries of the United Kingdom Parliament favour the Labour Party, which was able to win a majority in 2005 with a lower share of the vote than the Conservative Party had when they fell short in 2010.
Gerrymandering was common in the early days. When the provinces of Alberta and Saskatchewan were created in 1905, the boundaries of their provincial electoral districts were defined by the federal Liberals to benefit their provincial cousins. This became much less of a problem after responsibility for drawing district boundaries (both federal and provincial) was handed over to independent agencies, first in Manitoba in 1950 and then federally in 1964.
It was only in the 1980s that the control of political boundaries in Ireland was finally removed from the hands of sitting government ministers. Ireland gave us the term Tullymandering in the 1970s when minister James Tully did his utmost to fiddle electoral boundaries to ensure the return of the ruling Fine Gael/Labour coalition. He failed miserably and the opposition won a landslide victory in 1977, hence the birth of the term Tullymandering to describe the phenomenon of a failed attempt at gerrymandering .
Since independence in 1957, Malaysia has been ruled by the Barisan National coalition and gerrymandering has been a consistent feature of their rule. In the 2013 election, Barisan Nasional won 60% of the seats in the Malaysian Parliament despite only receiving 47% of the popular vote.
In Singapore, critics have long accused the ruling PAP elite of gerrymandering to maintain a significant parliamentary majority. The Elections Department fixes electoral boundaries and is part of the executive branch which reports to the (always PAP) Prime Minister. This has raised its ugly head yet again in advance of the Parliamentary elections expected in late 2015. 
Have a look at the popular vote and the seat allocation in this election. Bear in mind that it was the last election before Apartheid as we now know it was implemented. While the now-ruling African National Congress is far from perfect, it at least wins the elections it runs in.
Measures against it
Apart from alternative voting systems like single transferable vote, which help reduce some of the effects of gerrymandering, especially when more than two parties have non-negligible shares of the vote, the easiest way to make gerrymandering harder is having bigger districts with more members. If California has fifty districts, it is easier to finagle them in a way to produce any desired majority or even a House seat for the Green party. If there are five seats with ten representatives each (pretty much no matter how they are chosen) it is much harder to suppress minority or even majority opinions in the state. Ultimately bigger and bigger districts become indistinguishable from proportional representation which entirely avoids Gerrymandering by design, but has its own problems, including a disconnect between voter and representative as representatives are not based on the local area of a district and in most proportional representation systems it is difficult or impossible to vote a specific person in or out, as the vote is mostly for a list of several persons. There are systems that remedy those problems by giving one or several votes to chose specific persons with (including the possibility to vote for people from different parties on the same ballot), but those systems have their own problems the biggest of them being overly complex. In some countries there is a combination of proportional representation and district based voting either in two different chambers (e.g. district based upper house proportional lower house) or in the same chamber, but the latter can create distortions up to and including "negative weight" for votes, where a party can lose seats if it gains votes. In general it can be said that more complex voting systems have fewer problems (besides their complexity) but no ideal voting system exists, especially if there are more than two relevant parties.
- America’s most gerrymandered congressional districts, Washington Post
- Shaw v. Reno on Oyez.org
- Soffen, Kim, "How racial gerrymandering deprives black people of political power", WaPo 6.9.16. Pandering to white males is called "campaigning"!
- Ross, Janell, "The Trump campaign’s problematic definition of ‘pandering’", WaPo 5.27.16.
- Constituencies of Ireland, 1977 - 1981
- What’s Malay for gerrymandering?
- 10 things I learnt about the politics of gerrymandering in S’pore from reading The Straits Times