In the Ricardian model of trade, productivity differences across countries and industries determine the patterns of international trade-hence, comparative advantage (Costinot et al., 2012). As productivity differences increase over time, comparative advantage strengthens. Standard models of trade take these productivity differences, and therefore comparative advantage forces, as given (Eaton and Kortum, 2002, and Caliendo and Parro, 2015). However, understanding the determinants of comparative advantage is important in analyzing welfare gains from trade. Recently, several articles have studied endogenous forces that may cause differences in productivity across countries and industries (Sampson, 2017, Somale, 2017, and Cai et al., 2017). In these studies, innovation and its international diffusion across countries and industries are the main sources of differences in productivity. Countries and industries differ in both their ability to do research and development (R&D) and their ability to adopt innovations that have been developed elsewhere (i.e., international technology diffusion). Productivity differences across countries determine patterns of international trade-hence, comparative advantage. We use a multi-industry model of international trade to estimate a measure of industry productivity. We then quantify the effect that domestic innovation and technology diffusion have in explaining differences in productivity across countries and industries. Consistent with standard growth theories, we find the following: (i) Higher-income countries benefit more from domestic innovation than lower-income countries, whereas lower-income countries benefit more from technology diffusion; and (ii) the speed of convergence is larger for those countries and industries that are farther away from the technology frontier. To the extent that productivity differences determine comparative advantage, our findings suggest that domestic innovation and technology diffusion are endogenous sources of comparative advantage. (JEL F12, O33, O41, O47)