The extraordinary measures taken over the past 10 years by central banks, financial regulators, and bank executives themselves have made the global financial system more robust, write Susan Lund and Eckart Windhagen in Fortune.

A decade since the onset of the global financial crisis, the world’s major central banks have taken on new prominence in banking and capital markets—not by choice, but necessity. As the world’s central bankers gather for their annual meeting at Jackson Hole, Wyo. on Friday, they will take stock of a global financial system that is in much healthier shape and a global economy that is in the throes of recovery.

A main focus of market attention will inevitably be on when and how quickly the central banks will reduce the extraordinary support they have provided to the global financial system through massive purchases of sovereign bonds and other debt securities, as well as credit support for banks; since 2007, the assets of central banks of the United Kingdom, Japan, the Eurozone, and the United States have increased by $9.7 trillion, more than triple their previous size.

Less noticed—but as important for global financial stability—has been the huge shift in the state of financial globalization in the same period: In gross terms, cross-border capital flows of foreign direct investment, purchases of bonds and equities, and lending and other investment have declined by 65% since their peak 2007. Rather than a cause for concern, this is actually a healthy development. The excess liquidity, leverage, and “savings glut” that characterized global finance pre-crisis has been tamed.

Half of the decline in capital flows reflects a broad retreat from overseas business by major banks in Europe and the United States, finds new research from the McKinsey Global Institute. Under pressure from regulators and shareholders to rebuild their capital and profitability and meet new liquidity requirements, banks have shed international portfolios and exited markets. Eurozone banks are leading the retreat: Their foreign claims have slumped by $7.3 trillion, or 45%, since 2007, and nearly half of that has been claims on other borrowers in the Eurozone, particularly other banks.

The retreat has extended beyond the Eurozone: U.K., Swiss, and some U.S. banks have reduced foreign claims as well by selling foreign businesses, exiting some foreign markets, and simply allowing maturing loans to expire. According to Dealogic, banks have divested more than $2 trillion in assets since the crisis. The three largest German banks had two-thirds of their total assets in foreign markets on the eve of the crisis; today it is one-third. French, Dutch, Swiss, and U.K. banks have also significantly reduced the size of their foreign business.

On the available evidence, it does not seem likely that these banks will reverse this retrenchment anytime soon. New international regulations, as well as national policies, have made foreign operations more complex and expensive. New liquidity requirements have increased the cost of operating in many different foreign currencies, resulting in pools of “trapped capital” in far-flung markets. In any case, many banks have discovered with the benefit of hindsight that margins and profits available in foreign markets were not as high as in domestic business. Many risks were misjudged.

The good news is that what remains of financial globalization will arguably be more resilient, and potentially more stable. Two features stand out on this much-altered landscape. First, the mix of cross-border capital flows has changed remarkably, and should promote more stability. Annual flows of cross-border lending, the most volatile type of capital flows, have fallen by two-thirds; but foreign direct investment (FDI), the least volatile type of capital flow, has held up better. All equity-related flows (FDI as well as portfolio investments) now account for 69% of cross-border capital flows, up from 36% before 2007.

Second, global imbalances in national capital and financial accounts have shrunk, from 2.5% of world GDP in 2007 to 1.7% in 2016. The remaining deficits and surpluses are spread over a larger number of countries. In 2005, the United States absorbed 67% of the world’s net capital flows; by 2016, that share had fallen by half. China accounted for 16% of the world’s net capital surplus in 2005; by 2016, that figure was only 1%. Imbalances within the Eurozone have also declined, although Germany’s surplus has grown. Developing countries as a group have become net capital importers once again. All of this should promote stability.

Yet old and new risks remain. Central bankers have more work to do. Despite the positive news, complacency at this juncture would be a mistake. There is always a risk of contagion in what remains a tightly interconnected global financial system. Regulators must continue to build systemic risk monitoring capabilities and ensure prompt reaction to changing market conditions. New tools for managing volatility in capital flows and in reducing financial and capital account imbalances are needed. Equity market valuations are very high in some markets. And volatility in capital flows remains an issue for many emerging economies. Since 2010, one-third of developing countries experienced large fluctuations in total capital inflows in any given year, creating volatility in exchange rates and the broader economy.

The extraordinary measures taken over the past 10 years by central banks, financial regulators, and bank executives themselves have made the global financial system more robust. But if there is one thing we have collectively learned about financial markets, it is that stability is hard-won and can all too easily dissipate.