Gerrymandering does not conflict with the popular vote
It’s no objection to either one of them to say that they might cause an outcome that is different from the popular vote.
I don't know that that is true of gerrymandering. It would be more accurate to say that gerrymandering controls the circumstances of the popular vote. There is still a popular vote election in gerrymandered districts and the result determines the winner. There could be different results with different districting plans, but all of them would still be controlled by the popular votes in the districts.
By contrast, the electoral college can produce a different result than the national popular vote. The electoral college thus can differ from the popular vote.
Proportionality
The normal complaint of gerrymandering is that it causes the effect of the vote across all the districts to be different than the sum of the votes. But that's a consequence of how districts work. Iowa, a purportedly "fair" districting, currently has three Republicans and one Democrat in the House. Why? Because the Republicans did better in 2016 than the Democrats in three out of four districts.
It would not have been that hard to divide Iowa into four districts where two were Republican and two were Democrat such that only a huge wave election could have resulted in three Republicans winning. Or three Democrats winning. The northern rural areas and the southern rural areas would get their own districts. The central and eastern urban areas would have gotten their own districts.
Polk county would move from district 3 to district 1, and Story county would move from district 4 to district 1. District 1 would retain Black Hawk county as well as Marshall and Tama. This is enough for a 40,000 vote advantage for the Democrat (using the two party vote between Donald Trump and Hillary Clinton as a proxy). The population is about 75,000 low, so it might add Buchanan and part of Linn.
District 2 would get Democratic Linn county and give up Republican counties to district 3 to help replace Polk. So already Democratic district 2 would become more Democratic (and more compact, as it would replace a number of central rural counties with urban Linn towards the east). District 1 would become Democratic. District 3 would replace Polk with more Republican counties. District 4 would give up its only Democratic county (Story), so it would be Republican still (perhaps less Republican as it would have to give some of its counties to 3 and pick up more moderate counties from 1).
The net effect though would be to create two Republican and two Democratic districts. This would be a gerrymander to create proportionality. It would pack the most Democratic counties into two districts and the most Republican counties into two other districts. The effect would be to make Iowa perform more like its nature. Roughly half the voters usually vote Republican and about half usually vote Democrat. In 2016, more than half voted Republican while in 2008 and 2012 more than half voted Democrat for president.
The normal criticism of gerrymandering is that it doesn't usually do this. Instead of trying to match the districts to the proportional vote in the state, gerrymandering tends to try to maximize the number of districts for one party or the other. For example, in Illinois, gerrymandering in 2011 led to the House delegation changing from eleven Republicans and eight Democrats to twelve Democrats and six Republicans. Illinois lost one House seat in apportionment. So a swing of 4.5 seats from Republicans to Democrats.
Illinois is considered one of the worst gerrymanders in the country for producing 67% of one party. Iowa's districting produced a 75% majority for one party and is held up as an exemplar of how districting commissions work. Yet Illinois is more Democratic than Iowa is Republican. Barack Obama won a majority in Iowa, but Republicans still won 75% in 2014.
Claims about gerrymandering are political in nature. What is encouraged in one place is criticized in another. The Iowa districting plan embeds Democratic Polk and Story counties in otherwise Republican districts, preventing those counties from electing the kind of representation that they want. There are six counties in Iowa that voted Democratic for president, but they are spread over the four congressional districts. This is called cracking.
The commission effectively cracked the Democratic urban center to form three districts that voted Republican. If a legislature had done that, we'd be talking about how partisan that was. A commission did it and everyone pretends that it's somehow different.
Why redistrict?
All of the previous was just background about gerrymandering. As I understand your question, you want to know why we redistrict. There are two main reasons:
Apportionment changes. Every ten years the national government takes a census and uses the results to allocate or apportion House seats to each state. Sometimes a state will gain or lose one or more seats. When that happens, the state has to redo their districting plan to include or remove the seats.
Population shifts. Sometimes people shift within the state. This can lead to some districts having more population than others. To counter this, they redistrict people so as to leave districts that are close in size.
So the primary answer to what redistricting is supposed to accomplish is to balance out population. Note that gerrymandering generally includes this as part of its goals, as unbalanced population is a reason to invalidate districts.
There may be secondary goals. Such goals could include
- Support incumbents, so that most people can still vote for their current representative.
- Put minority voters together, so they have a better chance of getting a representative from the same ethnic or racial background.
- Put like-minded people together, so more people can be happy with their representation.
- Make districts follow existing boundaries as much as possible. So if a city or county is smaller than a congressional district, try to put the whole thing in one district.
Of course, some of those things can be considered gerrymanders. For example, protecting incumbents or putting minority areas or like-minded areas in the same district.
Alternatives to redistricting
If all the districts in a state were lumped into one group and the best performers were selected, then there would be no need for redistricting. Instead of state politicians determining the districts, the voters themselves would choose. One name for this system is Single Transferable Vote or STV. There are different variants of STV, including one that works like Instant-runoff Voting and several Condorcet-compliant ones.
Other systems compensate for the effects of districting. In Germany, they add representatives from the underrepresented parties until they are close to proportionality.