A widespread view holds that countries that finance themselves through foreign direct investment (FDI) and portfolio equity, rather than bonds and loans, are less prone to crises. But what determines countries' external capital structures? In a cross section of emerging markets and developing countries, we find that equity-like liabilities (FDI and, especially, portfolio equity) as a share of countries' total external liabilities (or as a share of GDP) are positively and significantly associated with indicators of educational attainment, natural resource abundance, and especially, institutional quality. These relationships are robust to attempts to control for possible endogeneity, suggesting that better institutional quality may help improve countries' capital structures. The results might also provide an explanation for the observed correlation between institutional quality and the frequency of crises.