We study the gains from trade in a model with oligopolistic competition, heterogeneous firms and innovation, and provide a formula to decompose the mechanism. The new insight we provide is that market concentration can be a welfare-relevant feature of market power above and beyond markup dispersion. Trade liberalisation increases foreign competition and reduces the number of active firms in the market, thereby increasing concentration. A more concentrated economy is more efficient due to increasing returns in production. Moreover, higher concentration produces a scale effect on firms’ incentives to innovate, which increases welfare via productivity improvements. In the calibrated version of the model we show that a trade-induced increase in concentration contributes substantially to the gains from trade, mostly via its stimulating effect on innovation. Sizeable gains also come from the reduction of the inefficiency produced by trade in identical goods; i.e. through a reduction in reciprocal dumping. Changes in markup dispersion, in contrast, have only negligible effects.