In Dresden, in east Germany late last year, the final car rolled off the assembly line at Volkswagen's "Transparent Factory", built to showcase the pinnacle of European industrial power. Thousands of miles away in Spartanburg, South Carolina, a different German giant, BMW, is running its biggest plant in the world.

The contrast between the two plants helps explain a puzzle economists have been debating for a while: why has the American economy continued to outperform so many of its peers, despite facing the same global shocks? Over the past few years, much of the developed world has buckled under a succession of shocks.

Trump's sweeping tariffs have disrupted global trade. Mass deportations are changing labour markets. And conflict in the Middle East has sent oil prices lurching. Many economists expected those pressures to weigh heavily on the US. Instead, the economy has continued to grow at a steady pace.

Inflation has proved stubborn at times, but the combination of weak growth and persistently rising prices that many feared hasn't happened. Joe Brusuelas, chief economist at RSM, argues the trade war itself became the strongest proof of American resilience. "The own goals that the Trump administration has imposed on the US with respect to trade and immigration are probably the single best example of the underlying dynamism of the American economy," he says.

Faced with a sudden tax on foreign components, US corporations didn't accept lower margins, they invested harder. "CapEx (capital expenditure) right now is 13.9% of US GDP," says Brusuelas. "That should be slowing, given the mix of supply and demand shocks the economy is absorbing, and it's not." Instead, much of that pressure has been offset by a notable rise in productivity.

The broader US economy has continued to expand at an annualised rate of around 2%. Energy markets offer another explanation. The war in the Middle East has pushed oil prices higher, a development that historically would have posed a major threat to US growth. But the shale revolution fundamentally altered America's exposure to energy shocks.

Over the past two decades, the US has become one of the world's largest oil and gas producers, while businesses have steadily reduced their reliance on petroleum. "The development since the early 2000s of fracking in the United States, alongside the evolution of alternative fuels, has created the conditions where oil's contribution to GDP per unit has fallen by half over the past 50 years," says Brusuelas.

The difference with Europe is clear. While the US has focused on flexibility, embracing fracking and letting prices respond to the market, Europe has relied on long-term contracts and interconnected supply networks to guarantee energy security. That approach left many countries exposed when Russian gas supplies were cut after the Ukraine invasion.

And given the current tensions in the Middle East, that vulnerability remains. For Rebecca Christie, senior fellow at the Brussels think tank Bruegel, the divergence is not just about policy choices but about cultural attitudes towards risk. "Americans are very solutions-oriented and much more comfortable with taking a short-term risk in service of a long-term advantage.

Europe as a culture is risk-averse." She says she was at an event where the EU's own commissioner for financial services said in Europe people don't talk enough about the risk of not taking risk. Even the difference in how businesses and retirement systems are structured reflects this divide.

In much of Europe, companies rely heavily on bank loans for financing, and workers' pensions are often tied to guaranteed insurance contracts that cap both losses and gains. "If you finance your business with a bank loan, you don't have the same flexibility that you do if you sell shares or attract venture capital," says Christie.

In the US, companies can tap investors and the stock market for financing. That flexibility, even with its ups and downs, gives American firms an advantage over state-backed European models. Still, Christie is careful to note that resilience at the macro level can mask genuine pain below it.

"The US is a land of very high inequality," she says. "If you're struggling, you are really going to have a hard time because the labour market is not adding piles of new jobs, things are getting more expensive, many cities have housing crises." Her deeper worry is that inequality hits a tipping point.

"Even then having the dollar and fairly stable banks won't help if you have a real jobs crisis in the real economy." So far, there is little evidence of that. In fact, American employers added 172,000 jobs in May, smashing expectations. But new inflation data this week, showing consumer prices rising at their fastest pace in three years, suggests the limits of America's resilience may be approaching.

Prices in May were 4.2% higher than a year earlier, up from 3.8% in April. America's economy may be outperforming many of its rivals. That does not mean it is immune. Higher energy prices, stubborn inflation and widening inequality all pose risks that could erode the country's current advantage.

Even so, compared with many other advanced economies, the US continues to look robust. Its combination of flexible markets, rapid investment, abundant energy, and tolerance for risk has helped it weather shocks that have strained its peers. As Brusuelas puts it: "It's the cleanest shirt in a very filthy laundry."