We must try to find ways to starve the terrorist and the hijacker of the oxygen of publicity on which they depend. (Margaret Thatcher, 1985, Speech to the American Bar Association)

After every new atrocity or catchy ISIS video the armchair psychologists and amateur Islamic theologians take to the air. Their low grade psychobabble turns tragic events into compelling TV narrative and brings mainstream attention to political opportunists. But even if it made better sense it would still be irrelevant. All these pundits are focused on the wrong thing: how particular individuals are recruited to terrorist groups and causes.Terrorism is not a personality type, a psychological illness, a theology, or a goal in itself. Terrorism is a technique, a particular form of warfare that the weak wage against the strong.If we want to stop terrorism we have to first understand it. That means acknowledging its rationality as a means to an end. The question we should be asking is, what are terrorist acts supposed to achieve and how?All terrorism is theatre, dependent on the collaboration of its audience for its effect. It is about capturing the public's attention and manipulating our emotions - including not only fear but also indignation and even rage - in order for a small (often tiny), militarily weak group to advance some political goal.* The specific form of terrorism chosen will vary according to the group's ambitions, inclination to violence, and strategic calculations. (And of course, just because terrorist groups are rational actors doesn't mean they will succeed in making the smartest choices. Businesses are rational but they still go bankrupt all the time).There are three distinct uses to which terrorism can be put: attention-seeking, extortion, and provocation.A lot of terrorism is simply concerned with getting the attention of a democratic polity. The key trick here is to hijack a society's news media by wrapping an irresistible spectacle around a political message that no one would otherwise pay attention to. This is the most common function of terrorism and it is compatible with a wide range of levels of violence, from the Suffragettes' arson and bomb attacks against property to ISIS beheadings videos.There are actually two parts to the attention-seeking function. In one, the agenda of the terrorists becomes a part of the mainstream conversation: finally their voice is heard! Arguments against religious defamation were seriously discussed in the aftermath of the Charlie Hebdo attacks, for example. Yet the conclusion of that public discussion was a pretty definitive rejection. Terrorists may fantasise that when everyone understands what they are fighting for they will be converted to the side of true justice, but terrorism tends to taint what is being sold. Even the Suffragettes, despite winning the biopic, arguably set back their political cause by undermining its moral foundation and splitting its popular support. (Gandhi and Martin Luther King wisely chose the path of non-violent civil disobedience instead: let the oppressors make the spectacle and thereby undermine their own moral authority.)The other part of the attention seeking function works much better: winning the biopic. The English suffragist movement had been going for a century and a half before the militant suffragettes appeared, but only the headline makers are now remembered. The point can be generalised. When a terrorist organisation commits an atrocity on behalf of some cause or some demographic it is not just their cause that receives attention but they themselves. The more the media talks about them, the more they come to be seen as the true representatives of that cause or demographic, side-lining all those committed to peaceful democratic protest, or mostly content with how things are.This is important to terrorists because their political goals include not only getting certain things done (like independence for Palestine) but also achieving political power over others (the Palestinians in Gaza). This competition for power is why terrorist groups spend so much time fighting other groups that are supposed to be on the same side.To generalise, terrorism involves a calculated trade-off between political power and political justice. Terrorists give up the wider moral legitimacy that arguments for the justice of their cause might bring in return for greater control over a narrower community that their own terrorism has left isolated. Al Qaida, for example, managed to persuade large numbers of Americans and their politicians and pundits - including, particularly shamefully, several leading New Atheists - that Al Qaida represented Islam and all 1.5 billion Muslims. What a coup!Groups that use terrorism are weak and small, by definition. Terrorism is so attractive for these groups because it costs almost nothing and the pay offs can be huge: in Al Qaida's case a trillion-dollar global media industry working for them. Sure, it hasn't gotten them everything they want, but being appointed the leaders of the Ummah by America was a big promotion for a bunch of losers hiding in a cave.Terrorism has a built in positive feedback loop. Atrocities are a means to get media attention. So the more attention the media gives atrocities, the greater the incentive to commit them. There is also a tendency to escalation, as viewers get bored of the same old thing and other terrorist groups compete for status. (Consider how ISIS displaced Al Qaida by bringing new levels of creativity and barbarity to its murders - as well as slicker video production values and social media operations.)The media is clearly complicit in this. They choose what to air and publish, and they choose based on how many viewers they will get (to sell to advertisers). However, though you may find the ethics of this disgusting and irresponsible, it is hard to see what could be done about it. In societies without a free media, like North Korea, terrorism is pointless. In societies with a free media, there is an unfortunate symbiosis between terrorism and journalism. In response to Northern Irish terrorism, Thatcher's government tried appealing to journalistic conscience by imposing a 'voluntary' code on the British media; releasing less information about attacks; and ultimately a legal ban on broadcasting direct statements by terrorist representatives or supporters. Unsurprisingly, none of Thatcher's ideas worked then - and they would be even less likely to work now, with a global internet and social media.But it isn't the media companies who are ultimately to blame anyway. They just give their consumers what they seem to want. Ifdidn't pay so much attention to atrocities in the first place, terrorists wouldn't bother to commit them. The simplest way to deter terrorism is to stop paying attention to it!Terrorism is designed to hijack our attention by mimicking the signals that our brains evolved to pay attention to. The combination of unexpectedness and horribleness tricks us into thinking that something very important is happening - even though it isn't. In most countries more people die from slipping in the bath. The same psychological mechanism is what makes child murderers and airplane crashes so newsworthy. But we are not tied to our sofas and forced to gawp at whatever new awfulness CNN shows us. We have the power and moral responsibility to direct our own attention. Targeted apathy is an underappreciated virtue and power. It's also the rational response to a problem that isn't real.Of course terrorism isn't only a cry for attention. It is also a way of threatening governments with their greatest fear: public embarrassment.A surprisingly small group of people who are sufficiently determined can deny a government full sovereignty over a large area/population. Specifically, although the group cannot take over the territory itself, it can void a government's promise of guaranteeing protection from political violence, and this is the fundamental promise on which the legitimacy of any government rests. (A commonplace of political philosophy since Thomas Hobbes.) The asymmetry of military power again works in the terrorist group's favour. It gets to choose when and where to attack. The government has to try to defend every possible target, which is impossible and also extremely expensive.This use of terrorism is not a threat to the modern, an entity that arguably evolved to fight wars at a far greater scale. But in democracies,are very conscious that they will be thrown out if they can't maintain the confidence of the citizenry. Democratic governments fear attacks because they fear embarrassment, not because they especially care about a few civilians getting killed. This is also why they invest an inordinate amount of resources in preventing exact repeats of previous attacks, like shoe-bombers, on the principle 'fool me twice, shame on me'.The genius of this use of terrorism is that the very security measures brought in to reassure the public of the government's efforts to protect them serve as omnipresent billboards advertising the terrorist threat. Every time you see a policeman with a machine gun in an airport or train station you are reminded of how powerful and dangerous the terrorist groups are. The British government managed to keep a lid on Northern Ireland, but only by putting it under effective martial law for several decades with thousands of soldiers patrolling the streets in full battledress. The inevitable mistakes and excesses of the security forces were a further public relations gift to the IRA, introducing ambiguity about who held the moral high ground.All this serves to raise the price that governments pay for denying terrorist groups what they want. Since they are also rational actors, sooner or later governments always talk to the terrorists and try to cut a deal. They are unlikely to give up core values or interests - unifying Ireland was never an option - but they can be moved to accept compromises they would never have considered before. Importantly, because it was the violence that brought the government to talk, it is the groups behind the violence with whom they negotiate the peace. Peaceful groups tend to get left out. Democracy is outflanked.The reason this kind of terrorism has to be solved diplomatically is that decisive military victory is elusive (with some exceptions, such as Sri Lanka - after 30 years). Militarisation in fact tends to entrench social divisions around the original sense of grievance by pushing large numbers of people who cannot sufficiently prove their loyalty to the state into the ambit of the terrorist group. Yet governments always resort to the military solution first and foremost and keep plugging away at it long after its limitations are clear. What should they do instead - or as well?Governments could wage a more effective war on terrorists by undercutting the justice of their cause and by raising the costs of participating in terrorism.First, there is no reason to wait for terrorists to appear to address significant social injustices, such as the anti-Catholic bigotry rampant in Northern Ireland's institutions before the Troubles. Terrorists typically represent an extreme end on a spectrum of political discontent. Addressing more reasonable complaints about injustice as early as possible - before any terrorist group can claim credit for achieving them by force! - isolates the terrorists from their pool of sympathisers and potential recruits, constraining its capabilities and life-span.Second, one can also reduce terrorist recruitment and retention by raising its opportunity costs, what people have to give up to pursue that life choice. This approach, outlined by Bruno Frey and Simon Luechinger , focuses on providing better alternatives to terrorism rather than merely tougher punishments. For example, better educational and employment prospects for dissolute youth in key communities (which also pull people into different, more bourgeois value systems) and golden parachutes for defectors. Other features include lowering the 'price' of alternative means of addressing grievances within mainstream democratic institutions. Democratic devices such as local referendums demonstrate what can be achieved via the democratic process, and also confront extremist groups with the reality of their democratic deficit.