Matthew Ygelsias astutely questions whether terrorism springs from dictatorship
by pointing out that Iraq and Syria produce few terrorists from among their citizens, while Spain and Ireland have had their share. I think this is only partially right. Iraq and Syria don't produce domestic terrorists because the level of state surveillance is so pervasive nothing could really get organized. Beyond that, people turn to terrorism as a tactic because they can't achieve their goals through other means. If you want your dictatorship to be a theocracy, you don't have the ballot box option. By the same principle, the non-Muslims people like Bin Laden see as enemies can't be defeated by conventional military means. Therefore, people turn to terrorism. So there is something of a link. This does not mean that spreading democracy will end terrorism, because if the terrorists feel they still won't get their way, they'll continue to be terrorists. Abu Musab Zarqawi is making this point rather effectively in Iraq.
UPDATE: Discussion of these points is found here