This paper establishes a robust stylized fact: changes in the revealed comparative advantage of nations are governed by the pattern of relatedness of products at the global level. As countries change their export mix, there is a strong tendency to move towards related goods rather than to goods that are farther away. The pattern of relatedness of products is only very partially explained by similarity in broad factor or technological intensities, suggesting that the relevant determinants are much more product-specific. Moreover, the pattern of relatedness of products exhibits very strong heterogeneity: there are parts of this ‘product space’ that are dense while others are sparse. This implies that countries that are specialized in a dense part of the product space have an easier time at changing their revealed comparative advantage than countries that are specialized in more disconnected products.