Three attackers armed with machine guns and strapped with explosives conducted a frontal assault on Istanbul Atatürk Airport on June 28. The brutal attack left dozens dead and hundreds injured. Excluding smaller-scale bombing attacks of police and military targets, the airport bombing has been the 11th mass civilian casualty terrorist incident in Turkey since June 2015, leaving more than 250 civilians dead.

Turkey faces a growing threat from ISIS, as well as a domestic Kurdish insurgency. The latter has been met with punitive use of force to make up for failed political attempts since June 2015, generating both domestic migration and further radicalization.

In addition, Turkey’s tense relations with Russia and Israel (despite recent moves toward reconciliation) and the sustained quagmire in Syria and Iraq generate a wide spectrum of security concerns for the government in Ankara. Add to this the demographic stress of nearly 3 million Syrian refugees in Turkey’s southern provinces, and the scope of economic and security difficulties becomes even more formidable.

Yet despite these stresses, the Turkish economy has stayed surprisingly resilient. A deep economic crisis like the ones seen in Greece and Spain has not happened. There are several reasons why I believe Turkey’s economy has maintained momentum.

Instability and terrorism are having little impact on private consumption. At this time, the resilience of the Turkish economy stems in large part from the domestic price stability that comes with low oil prices. If they rise, a more problematic picture will emerge. Turkey can’t rely on the current price stability forever, but it is helping now.

The main driver of the Turkish economy is the extent of private household consumption, which covers roughly 70% of Turkey’s GDP. Despite the large number of uncertainties and security threats, the resulting internal migration, both from people in Kurdish areas and from Syrian refugees, has had a positive effect on household spending, which increased by 5% in the first quarter of 2016. While it feels counterintuitive, such a large number of migrants creates an economy in and of itself.

In addition, Russian sanctions on Turkish food exports (imposed after a Turkish fighter jet shot down a Russian military plane on the Turkey-Syria border) led to a substantial drop in local food prices. This had a favorable impact on inflation in the first quarter of 2016.

Turkey’s stability is threatened. But so is everyone else’s. In some ways, the Turkish economy relies on regional and global uncertainties, in that it offers a comparatively better place to do business. So despite terrorist attacks and domestic instability, Turkey’s financial institutions, culture, and systems are better positioned than their counterparts in neighboring countries. This continues to make Turkey a good base of operations for many international businesses that are invested in the Middle East, the Balkans, and the Caucasus — inherently high-risk areas.

In addition, the economic crises in Greece, Spain, Poland, and Italy, the economic slowdown in China, and the enormous business uncertainty posed by Britain’s vote to leave the EU all mitigate the relative severity of Turkey’s security problems. Turkey’s general credit rating is still higher than that of Brazil, Croatia, Portugal, Cyprus, and Serbia. Despite its political risks, Turkey climbed two spots in 2015 to become the world’s 20th most popular destination for foreign direct investment.

This doesn’t mean the Turkish economy can stay afloat if security and terrorism problems continue. But it does help explain how the country has managed to insulate its economy so far.

Terrorism impacts tourism, but not for as long as you might think. It generally takes a country about 13 months to recover from a terrorist attack, according to the World Travel and Tourism Council. That’s less time than from a natural disaster or political unrest. This is because terrorist attacks don’t create substantial infrastructure or service provision damage that impairs the logistics and conduct of tourism.

The trade group study shows that tourism can drop off more sharply if terrorism is combined with substantial economic problems that directly impact the conduct of the tourism industry — but that is not the case in Turkey. The country is suffering from a substantial decline in tourism (down 23% compared to the first five months of 2015). Even so, more than 8 million tourists visited Turkey last year. It remains the sixth most visited country in the world.

Turkey’s tourism economy is poised to recover from the recent airport attack. But that could certainly change if similar terrorist attacks continue.

Political momentum is pro-business. Despite significant political risks associated with investment and capital flows, the political climate in Ankara favors easing foreign investment in Turkey, including making necessary legal reforms to ensure investment security. Such promises should be taken with a pinch of salt, especially given how political feuds and ample partisan priorities have stunted business confidence in the country.

Still, foreign investors who manage to stay outside Turkish politics likely will benefit from the business environment. Indeed, Turkish government agencies boast about their role in the reported 32% increase in foreign direct investment in 2015, focusing specifically on manufacturing and energy sectors.

Although such receptivity doesn’t mitigate the risks associated with investing in Turkey, investors nonetheless find an accommodating political climate when they do so. This pro-business government policy is helping to cushion some of the shocks associated with political and security risks.

Turkey’s true economic challenges are structural. The country’s business and economic outlook hinges on problems other than terrorism and security. The domestic saving rate, stagnant productivity, unemployment, and rapidly increasing labor costs all adversely affect growth. These things need to be addressed by enacting substantial, long-overdue structural reforms that mostly are independent of security concerns. (Although if terrorism has an impact on tourism, that could exacerbate unemployment). Making these reforms depends entirely on political will and stamina — two variables that rarely coexist in Turkish politics.

In some ways, the story of Atatürk Airport offers a good analogy for why the Turkish economy has been able to withstand such turmoil.

Atatürk is one of the best-protected airports in the world. Turkish and international airlines diverting flights away from Istanbul is unlikely. Indeed, Atatürk restarted operations a few hours after the attack — a far cry from, for example, Brussels Airport, which was closed for two weeks after a similar attack there earlier this year. Geographically, it is easier to divert air traffic into adjacent high-volume airports in Europe. In Turkey’s part of the world, there is neither the security nor the airport infrastructure to handle high-volume air traffic. Atatürk is the world’s 11th busiest airport, and no other airport in its vicinity comes close to matching its volume. Simply put, the world has come to rely on Turkey as a hub of transportation and commerce.

To better combat terrorism, Ankara will have to find a mixture of political and security solutions in addition to building alliances (such as mending ties with Israel and Russia). Yet while security risks are substantial, there are more-important structural issues to deal with that have far bigger and more-lasting impact on the Turkish economy. Turkey needs to strive for political and legal stability in order to enact these long-overdue reforms.