The events in Iraq, where the Islamic State in Iraq and Syria (ISIS) has been mounting an offensive against the ill-prepared Iraqi army, raises important questions about political Islam and about the response to it by both Middle Eastern governments and the West.

After the attacks of September 11, 2001, the increased perception of political Islam as a major security threat led Western governments to boost support to authoritarian regimes in the Middle East as long as they were secular and therefore seen as superior to their theocratic alternatives. When the Egyptian military brought down President Mohamed Morsy of the Muslim Brotherhood in July 2013, there was a sense of relief among many observers in Washington.

Some of them may be willing to give Egypt’s current military regime a pass even after its judiciary convicted three Al-Jazeera journalists for seven years for “aiding terrorists” — not to mention recently upholding death sentences for 183 Muslim Brotherhood supporters, who allegedly organized an attack on a Cairo police station last year. Yet the repression of Islamic political movements, such as the Egyptian Muslim Brotherhood, often backfires, with consequences that could be as dire as the current bloodbath in Iraq.

Instead of rushing to alarmist conclusions, we need a careful and dispassionate analysis of why Islamic political organizations succeed in some Middle Eastern countries. Somewhat surprisingly, this may have little to do with religion. In survey data from Muslim-majority countries, religious beliefs seem to be only weakly related to voting patterns or opinions about specific policy issues. Instead, the appeal of Islamists lies in the credibility with which they can make electoral promises, which itself has to do with their history and organization.

Before the coup, Egypt’s Muslim Brotherhood was the prime example of the success of Islamic politics in the Middle East and North Africa. The group was originally founded in 1928, and over time created a loose network of Islamic parties throughout the region and a widely emulated model of organization combining political and religious activism with the provision of social services.

Secular Arab regimes typically allowed the Brotherhood and similar groups to run hospitals and schools and to provide assistance to the poor. In 2006, the Brotherhood was running hospitals and schools in every governorate in Egypt. Islamists were also among the first and most effective to provide relief during large-scale disasters, such as the earthquake in Algeria in 1989. In other locations, Islamists run sports clubs, collective weddings, or provide Sharia-friendly business loans.

As a result, Islamic political groups developed trustworthy brand names — a unique asset in a political environment where most voters saw politicians as crooks (often for good reason). The reality is that electoral promises in transitional countries are generally not worth much. But when a political organization can show a 70-year record of social service provision, people are more willing to listen.

So the success of religious parties can be seen as good news because political credibility and brand names are usually in short supply in transitional countries. But as I have noted previously, the fact that voters find such groups credible tells us little about policies they will really deliver — and those policies can be antithetical to freedom and democracy. Worse yet, as the examples of Hamas and Hezbollah show, organizations that can successfully provide public goods can also successfully organize political violence.

True, the advantage that Islamists currently enjoy in some Arab Spring countries can be expected to weaken — as has been the case in Indonesia — as other political groups establish their own brands and build reputation. But that requires open, competitive, democratic political arenas, in which Islamists can compete for votes alongside secular political groups.

If anything, the repression of Islamists creates incentives for them to turn to violence as an alternative way of advancing their agenda. The example of Iraq follows this logic. For years, the divisive politics and authoritarianism of Prime Minister Nuri al-Maliki alienated the Sunni part of the population and provided fertile ground for the success of ISIS.

It would be an unspeakable tragedy if the Iraq scenario repeated itself elsewhere. Sadly, by continuing to provide political backing and financial aid to secular dictatorships in the region — for example, to the regime of Abdel Fattah al-Sisi in Egypt — we may be encouraging the very outcome we seek to avoid.