The causes of the 2008 collapse and subsequent surge in global capital flows remain an open and highly controversial issue. Employing a factor model coupled with a dataset of high-frequency portfolio capital flows to 50 economies, the paper finds that common shocks - key crisis events as well as changes to global liquidity and risk - have exerted a large effect on capital flows both in the crisis and in the recovery. However, these effects have been highly heterogeneous across countries, with a large part of this heterogeneity being explained by differences in the quality of domestic institutions, country risk and the strength of domestic macroeconomic fundamentals. Comparing and quantifying these effects shows that common factors ("push" factors) were overall the main drivers of capital flows during the crisis, while country-specific determinants ("pull" factors) have been dominant in accounting for the dynamics of global capital flows in 2009 and 2010, in particular for emerging markets.