Last week Indonesia celebrated Eid, the festival that marks the end of Ramadan. Tens of millions of people left urban centres to rejoin their families as the world’s largest Muslim nation geared up for five days of prayers and feasts. As Indonesians returned to work on Monday, migration flows reverted to their source – growing even bigger as thousands of rural folks joined their kin to seek jobs in the city.

Ebbing and flowing is also what global capital has been up to since the UK voted to leave the EU on 23 June. Catching investors wrong-footed, the Brexit shockwave initially caused emerging market assets to tumble. But that didn't last long: the MSCI Emerging Market index reached a two-months high the following week; most currencies also wiped out losses, some hitting near-yearly peaks. EM bond funds meanwhile posted their biggest weekly inflows on record.

The trend could last. The Institute for International Finance, an investor trade body, this week said that it expects non-resident capital inflows into emerging markets to reach $550bn, double the 2015 tally, while outflows could be halved from last year’s level to $350bn. With the exception of Central and Eastern Europe, capital flows to developing nations should “continue to revive in the post Brexit world”, its latest monthly report argues.

This resilience is something of a novelty. In the past, when uncertainty rose as a result of global shocks, emerging market assets were often the first to be dumped. In fact, the simple fear that a negative event may materialise has often been enough to provoke a small exodus towards 'safe havens' like gold, government bonds or the Swiss franc. Emerging markets, for instance, took a big hit during the Eurozone debt crisis.

But this time it's different. For one, the UK referendum's surprise result - and the ensuing chaos in Westminster - has shown that political risk is not the preserve of emerging markets. One of the main lessons China is learning from all this, indeed, is that “democracy can be catastrophic”, in the words of seasoned Chinese observers.

Global economic forecasts have also taken a hit, but more so in the West than in the developing world, swathes of which have only minimal exposure to the UK. Fewer concerns about the Chinese economy, a slight pick-up in commodity prices and hints of a turnaround in emerging market growth make developing nations look comparatively good.

But perhaps the crucial factor is what central banks have pledged to do to keep Western nations afloat. Signs are that both the ECB and the Bank of England will for years keep interest rates at historical lows; they’re promising to do "whatever it takes" to boost activity by injecting billions in the economy - mostly through quantitative easing (the buying of bonds with newly printed money). In the face of global turmoil the Fed is also postponing a rate rise, despite solid job and GDP data in the US.

All this further depresses returns on safe assets, directing capital flows towards higher-yielding ones – such as those offered by emerging markets. Indeed, it is when the Fed pulled the breaks on its own QE programme in 2013 that riskier assets first fell down a cliff (an episode remembered as the taper tantrum).

Yet even today, many emerging markets remain vulnerable. It’s not because they now look “three-pint beautiful”, as a commentator put it last week, that the problems that were plaguing them before have suddenly disappeared. Brazil is still suffering its worst-ever recession. With oil prices weak and sanctions still in place, Russia’s economy isn’t exactly racy either. China’s growth appears dangerously lopsided: dwindling private investment is only being offset by state-driven infrastructure programmes, a lot of which don’t have an economic rationale. And emerging markets as a whole remain heavily indebted, most notably through over-leveraged corporates.

Emerging markets’ exposure to Brexit is therefore limited, if you discount the effect of Boris Johnson’s promotion to UK foreign minister on their diplomats’ morale. But a consistently stronger US dollar (which would make debts harder to repay) and renewed worries about China may still throw them off course. Global trade, weakened by sluggish growth in the West and creeping protectionism everywhere, won’t be here to help. It’s too early to ascertain how long investors will commit to vote Remain.