One of the fundamental principles of microeconomics that professors attempt to impart to introductory economics students is that what is most often economically relevant is what is taking place on the "margin" — what responds to small changes. For example, if the supply of milk goes down, people who will never buy milk, or will buy exactly half a gallon a week regardless of the price, aren't relevant to the analysis of how much the price will change; what matters is the "marginal consumer", the person who might decrease milk consumption if price goes above some relevant level.
Another tradition of economists is to apply economics to subjects that often aren't considered economic, especially if they are in the social sciences. What I want to discuss here is gerrymandering, but this is an economics blog, so I wrote the first paragraph as an excuse to address that topic.
Consider the task of a state legislature — taken as a unitary agent — that has no interest other than supporting the party of its majority as it draws Congressional districts. (One might hope our elected representatives would be more high-minded; one might expect they would be less high-minded, looking to disproportionately protect incumbents of both parties with the expectation that doing so with Congressional districts will facilitate coordination on doing so with state legislative districts. Abstract away from that.) There are traditionally two different approaches to take: try to put the same number of people from your party in each district, in an attempt to sweep the districts, or create a few districts that lean heavily to the other party, such that your party has a safer majority in a majority of districts. On some level there's a continuum here; how many districts do you give to the other party? In Massachusetts, where all 10 representatives are currently Democrats, the correct answer is surely 0 (for the Democrats). In other states, it might make sense to increase that number; each district conceded will, of course, reduce by 1 the number of districts your party could win, but may increase the number of districts will win.
The correct answer, in general, I think, is that you figure out what portion of the electorate in each precinct would be voting for your party when the House of Representatives as a whole is likely to come out about 218-217. In Massachusetts, where Democrats went 10-0 in a heavily Republican year, no district is likely to be vulnerable under any but the most extreme circumstances; a blindly partisan Democrat drawing Massachusetts's 9 districts for 2012 would see little value in conceding a district to the Republicans to make sure to have 8, instead of 7, votes in a tiny minority if the House moves further toward the Republicans. In most states, if there were no other barriers to arbitrary gerrymandering, it would seem like a similar result would obtain, if less dramatically; if one party has control of the redistricting, it is likely that that is the party that would see the most votes in an election year that was close nationally, in which case it would prefer to spread out its supporters in an attempt, for example, to give all 13 of North Carolina's house seats to the Republicans when the rest of the country is breaking 217-205 for the Democrats.*
In Pennsylvania, where Republicans control redistricting and the state leans slightly more toward Democrats than is the case nationally, it would make sense for (again, single-minded, otherwise-unconstrained) Republicans to create 2 safe Democrat seats so that the other 16 seats would give Republicans close to 10 point margins in a year like 2010, with perhaps 1 to 3 point margins in a year when control of the House was on the line.†
In most states, redistricting is not entirely in the control of one party, and even where it is, there is often an ongoing understanding that incumbents from each party are largely to be protected. Voting patterns shift over the course of ten years, as voters move, die or turn 18, or simply change their habits; people drawing district lines may have a form of loss-aversion, or perhaps simply a fear of embarrassment, that would make them reluctant to draw districts that could easily give the entire congressional delegation to the other party at some point in the next decade. There are also factors other than party that play into voting patterns, incumbency not least among them, that will have an impact on this analysis. In addition, it is at least nice to believe that too aggressive gerrymandering would be punished by voters, though I expect in practice that is much smaller than the other constraints.
* In North Carolina, Republicans control the redistricting process, and while North Carolina voted for Obama in 2008, Republican House candidates got a bit over 54% of the two-party vote in 2010, while the figure for the median house district nationwide was around 53%; similarly, Obama won North Carolina with a narrower margin than any other state. North Carolina's current districts were gerrymandered by Democrats; of North Carolina's current 13 House seats, 5 were won comfortably (a margin of at least 7%) by Republicans, 8 by Democrats. (One seat was within 1%, and was won by the Republican.) North Carolina is, however, subject to the Voting Rights Act, and, taking account of that and other constraints, it is likely that Republicans will draw a few heavily Democrat-voting--racial-minority districts and about 8 secure Republican districts.
† This year Republicans won more votes than Democrats in House races in Pennsylvania, but only by about 1% of the votes cast.