When will the median voter in a country support terrorist activity?  It depends on whether the terrorism is directed inwards into the country, or outward against an opponent.

For example, the terror acts emanating from Pakistan and directed towards India or vice-versa might be supported by the average citizen in each country.  India and Pakistan have a Cold War mentality that makes the average citizen hostile towards the other nation.  Democratic leaders who fight cross-border terrorism may alienate the voters.  A dictator can survive in power even without the average citizen’s approval.  This implies that an outsider like the U.S. which does not want cross-border terrorism (perhaps it also generates attacks on the U.S.) favors a dictatorship in Pakistan over democracy.  This is the kind of rationale behind a preference for Musharraf over Nawaz Sharif.

But there is a second effect.  If a leader starts fighting terrorists, they can turn violence inwards.  Al Qaeda in Iraq started fighting not only the US forces but attacking the population.  Eventually, the population turned on Al Qaeda in Iraq.  At that point,   a democratic leader has a better incentive to control terrorism than a dictator.  The dictator may fear for his own life and is not subject to election.  He has all the incentive not to eliminate terrorism.  If he deal with it too effectively, it eliminates his main reason for being in power in the first place.  A democratic leader has to respect the wishes of the average citizen to survive in power.  If the average citizen suffers from inward-directed terrorism, a democratic leader has to deal with it to survive in power.  This effect favors democracy over dictatorship if the objective is to eliminate terrorism.

There are two countervailing effects in even this simple theory.  In any program of democratization to reduce terrorism, we have to make sure the median citizen in the country being democratized shares our preferences.  This is the simple fact that was overlooked when Palestinian elections were encouraged and the American administration was surprised as Hamas won the election.