A key feature of developing economies is that wages in agriculture are significantly below those of other sectors. Using Brazilian household surveys and administrative panel data, I use information on workers who switch sectors to decompose the drivers of this gap. I find that most of the gap is explained by differences in worker composition. The evidence speaks against the existence of large short-term gains from reallocating workers out of agriculture and favors recently proposed Roy models of inter-sector sorting. A calibrated sorting model of structural transformation can account for the wage gap level observed and its decline as the economy transitioned out of agriculture.