This paper proposes a theory to explain the relative wage-rate increase for skilled labor that results from trade liberalization that relies on within-sector reallocations of production resources (skilled and unskilled labor) across firms. Motivated by some stylized facts, in a model with firm heterogeneity, including firms that differ in their skill intensity even within a narrowly defined industry, firms with relatively high skill intensity that are more likely to be exporters, and a positive association between a firm's skill intensity and its product quality, I develop a general equilibrium model where firms with a higher skill intensity endogenously choose a higher-quality product, and tend to be more profitable. In this framework, a reduction in trade costs allows members of the workforce to reallocate to more efficient firms that produce higher-quality products, using their skilled labor more intensively, resulting in a rising skill premium. The main sources of the increasing wage inequality that followed trade openness are a positive link between a firm's skill intensity, its product quality, and quality competition.