We derive a theory-based gravity-type equation that determines the main drivers of international technology diffusion under perfect enforcement of intellectual property rights. We estimate the gravity equation using bilateral royalty payments data for a sample of 53 countries and the period 1995-2012 to infer the amount of technology diffusion predicted by the model. We then analyze differences between the model and the data, and find that they are mainly driven by characteristics of the importing-technology country that are not captured by the model. We explore the role of three channels: (i) imperfect intellectual property rights protection, (ii) the structure of production, and (iii) profit-shifting motives. Controlling for these three channels significantly improves the fit of the model: (i) and (ii) are especially relevant for developing economies, whereas (iii) is important for tax havens.