Earnings inequality in urban China has grown rapidly the past two decades. During the same period, the composition of the urban labor force has been dramatically altered by three large-scale structural changes: (1) the expansion of tertiary education; (2) the decline of state sector employment; and (3) a surge in rural-to-urban migration. In this article, I examine how these institutional and demographic shifts have shaped the recent upswing in earnings inequality. Based on data from two nationally representative surveys, I use variance function regressions to decompose the growth in earnings inequality from 1996 to 2010 into four components: changes in between-group earnings gaps, changes in within-group earnings variation, and two types of composition effects (distribution effect and allocation effect). I also employ counterfactual simulations to evaluate the utility of different explanations. Results show that nearly half of the growth in earnings inequality during this period is due to increases in returns to education, and that the other half can be attributed to compositional changes in the labor force. The composition effects stem chiefly from the expansion of tertiary education and the shrinkage of state sector employment.