For more than three decades, the Supreme Court has recognized that severe partisan gerrymandering can violate the Constitution. But until Whitford, not a single federal court had struck down a map on this basis. Early litigants lost because the standard the courts used prior to 2004 was so demanding it could never be met. Since 2004, the courts haven’t even been able to agree on a test, rendering most lawsuits hopeless. However, in a 2006 case, five justices expressed interest in statistical metrics that show how a plan benefits (or handicaps) a given party. The efficiency gap is such a metric.
Source: The research that convinced SCOTUS to take the Wisconsin gerrymandering case, explained – Vox