"We will not be cowed by these sick terrorists," said British Prime Minister David Cameron after ISIS produced a grisly video of the mass beheading of Syrian captives by foreign jihadis who allegedly included British fighters. "We will not be intimidated," said Canadian Prime Minister Stephen Harper after the recent attacks in Montreal and Ottawa. As if the purpose of terrorist attacks in Western countries was to cow and intimidate them.

You hear this sort of rhetoric from Western leaders all the time, but Harper went further, and demonstrated exactly how they get it wrong. "[This] will lead us to... redouble our efforts to work with our allies around the world and fight against the terrorist organizations who brutalize those in other countries with the hope of bringing their savagery to our shores. They will have no safe haven." Sound familiar?

Sure enough, there are now half a dozen Canadian planes bombing ISIS jihadis in Iraq (although it’s unlikely that either of the Canadian attackers, both converts to radical Islam, had any contact with foreign terrorist organizations). But Harper has got the logic completely backwards.

The purpose of major terrorist activities directed at the West, from the 9/11 attacks to ISIS videos, is not to "cow" or "intimidate" Western countries. It is to get those countries to bomb Muslim countries or, better yet, invade them. The terrorists want to come to power in Muslim countries, not in Canada or Britain or the US. And the best way to establish your revolutionary credentials and recruit local supporters is to get the West to attack you.

That’s what Osama bin Laden wanted in 2001. (He hoped for an American invasion of Afghanistan, but he got an unexpected bonus in the US invasion of Iraq.) The ISIS videos of Western hostages being beheaded are intended to get Western countries involved in the fight against them, because that’s how you build local support. So far, the strategy is working just fine.

The "Global Terrorism Index," published annually by the Institute for Economics and Peace, reported last week that fatalities due to terrorism have risen fivefold in the 13 years since the 9/11 attacks, despite the US-led "war on terror" that has spent $4.4 trillion on the wars in Iraq and Afghanistan and anti-terrorist operations elsewhere. But it’s not really “despite” those wars. It’s largely because of them.

The invasions, the drone strikes in Pakistan, Yemen and Africa, the whole lumbering apparatus of the “global war on terrorism” have not killed the terrorist beast. They have fed it, and the beast has grown very large. 3,361 people were killed by terrorism in 2000; 17,958 were killed by it last year.

At least 80 percent of these people were Muslims, and the vast majority of those who killed them were also Muslims: the terrorists of Islamic State (ISIS) in Iraq and Syria, Boko Haram in Nigeria, the Taliban in Afghanistan and Pakistan, and al-Qaeda and its offspring in other parts of the world (like al-Shebab in north-east Africa).

That is not to say that terrorism is a particularly Muslim technique. Its historical roots lie in European struggles against oppressive regimes in the late 19th and early 20th centuries, and it gained huge currency in liberation struggles against the European colonial empires after the Second World War. Even the Stern Gang in Israel and the Irish Republican Army can be seen as part of this wave.

Later waves of fashion in terrorism included the European, Latin American and Japanese "urban terrorist" movements of the 1970s and 80s – Baader-Meinhof Gang in Germany, Red Brigades in Italy, Montoneros in Argentina, Japanese Red Army and so on – none of which has any political success at all. Specifically “Islamic” terrorism really begins only in the 1990s, with the rise of radical, anachronistic forms of Sunni Islam.

Only about 5 percent of the victims of this latest wave of terrorism lived in developed countries, but it was their deaths, and their governments’ ignorant responses to them, that provided the fuel for the spectacular growth of jihadi extremism. So what can be done about it?

The Global Terrorism Index has some useful observations to offer about that, too. It points out that a great many terrorist organizations have actually gone out of business in the past 45 years. Only 10 percent of them actually won, took power, and disbanded their terrorist wings. And only 7 percent were eliminated by the direct application of military force.

Eighty percent of them were ended by a combination of better policing and the creation of a political process that addressed the grievances of those who supported the terrorism. You don’t fix the problem by fighting poverty or raising educational levels; that kind of thing has almost nothing to do with the rise of terrorism. You have to deal with the particular grievances that obsess specific ethnic, religious or political groups.

And above all, keep foreigners out of the process. Their interventions ALWAYS make matters worse. Which is why the terrorists love them so much.