It has been a terrible weekend. After the Paris massacre on Friday, our friends have taken to Facebook in droves, all telling each other how it’s time to get tough with the bad guys, how there’s no answer to violence but violence, how we now have to kill or be killed, how we all need to join the NRA and carry loaded firearms, how Benjamin Netanyahu was right, and how Europe is now getting its just reward for not taking seriously the threat that Israel faces 24/7.

How ugly we have become. And how stupid. One characteristically demented opinion writer in a respected British newspaper says that the terrorists of Islamic State “will only be defeated by … our own willingness and ability to use violence against them”. She — for yes, this new call for merciless reprisals is proving as attractive to women as to men — she adds that we have finally to get to grips with the concept that the Islamists hate us and that they just want kill us all.

“This has nothing to do with anything except the fact that we exist,” says this genius of socio-political pathology. “It is that, and that alone, which offends them and which they seek to destroy.”

Now, let’s step back from the understandable rage of the mob. It is absolutely necessary to stop treating the jihadi phenomenon as if it came out of nowhere, as if its behaviour was random, and as if its impulse was irrational. There may be hatred, and we may consider it evil, but that is not enough of an explanation, and it does not move things forwards to say or even think so.

Jihadism is not new. In all major respects, it conforms to phenomena we have seen throughout history. It is a rebellion against established order and it is motivated by two main forces, one negative, one (in the eyes of its adherents) positive: a sense of grievance and a sense of group identification.

In the first case, radicalised jihadis have a complaint, or a set of complaints. What their complaints may be depends on where they come from. It may have to do with the conditions they live in in their countries of origin; it may have to do with their life prospects and status here in the West.

Whether we agree with their complaint or think it justified is neither here nor there (though it would be helpful to articulate it better than we have done): the fact is, they feel it. Up to that point, however, there is nothing they can do about it. Complaint alone does not empower them to act.

It is when they sign up to radicalism that life seems to offer them a remedy. They suddenly get comfort and support from identifying with others who feel as they do. They cluster around the bogeys of America and Zionism and capitalism, the cultures of which they might otherwise aspire to (and may secretly do). They have, in short, something external to blame for their ills—something about which they know nothing—and as a result they feel better about themselves.

Unfortunately, from our point of view, the group culture that they sign up to reinforces itself by burnishing and exaggerating their grievances to the point at which the one thing they are encouraged to do—act violently—is portrayed as equalling their hurt and justified by it.

For us, this is a false equation. “We”, in the West, have taken “them” in, given them access to “our” civil liberties and welfare, and tried, clumsily, to bring stability to the benighted countries from which they come. They should be grateful. Instead, they return our kindness with a spectrum of responses ranging from ingratitude to terror.

The politics of this ought to be obvious. If the grievance could be removed, there would be nothing left to motivate the terror. The culture of fundamentalist lunacy would expire because its adherents would be more easily satisfied. In the end, living a quiet life is easier than living on the edge, and—for most—more desirable.

The trouble is the scale of the problem. In every town and city in the West and the Middle East and North Africa and South Asia, there are disaffected individuals and groups who see no place for themselves within the status quo, and aren’t prepared to put up with it any more, or—worse—who think that violent jihadism offers them a really attractive alternative.

Under these conditions, the problem can only continue and grow—as it is doing.

How can it be reversed? There are many mechanisms, but they are all related one way or another to the two push and pull factors of grievance and identification.

In theory, if the conditions that promote grievance could be repaired, those grievances ought to lose their force. In Muslim countries, this would mean settling centuries of inequality between Sunnis and Shi’ites, redressing the balance of political under-representation, and managing fairer economic opportunities.

In the West, it would mean responding to the social, health, educational and cultural needs of Muslim communities with enthusiasm rather than mealy-mouthed resentment. What the voice of disaffection tells us is that it wants a higher status—respect—than we have been willing to offer, and an end to what must seem to the Muslim masses like a permanent condition of marginalisation and outsiderdom.

(Our neglect of the economic and social conditions of our African and West Indian immigrants has not prepared us well for this, to say nothing of our complacency towards our own native white under-classes. It ought to amaze us that the violent revolt now being seen as Islamic has not already tempted those with longer cause for complaint.)

The other factor in reversing the terror would be for jihadism to be seen by its own people as having failed. Currently, fragmented groups appear to be coming together under the IS banner, and this is giving the extremists a coherence, focus and dynamism that they have not previously enjoyed. If, however, the current convergence were to go into reverse, so would the fortunes of the movement.

Reversal might result from mutual enmity and competition between different leaders. It might result also from generational change, with young up-and-comers vying with older religious and military leaders for supremacy. Reversal might also arise from internal mismanagement and incompetence, or from obvious and perceived ineffectiveness in its carrying out its stated aims.

None of this appears to have happened yet but the possibility is ever present. So is a simple and inexplicable change of mood. But neither of these can be banked on.

What, then, can we in the West do? History’s answer was to militarise the problem, and we have already seen just that in the last week. Two days after Friday’s carnage in Paris, France carried out what it called a “massive” airstrike on an Islamic State training camp in Syria, just as Russia did following the apparent bombing of a passenger aircraft en route from Sharm el-Sheik to St Petersburg at the end of October. In both cases the object, it would appear, was both punitive and deterrent.

In the past, powers capable of doing so would punish aggressors by waging all-out massacres of their own, wiping out entire armies, as Alexander the Great did, or razing cities to dust, as military commanders did from Genghis Khan to Sherman in the American Civil War. Nineveh, once the proud capital of the Assyrians, was eventually obliterated by a coalition of those it had conquered.

A third military tactic would be conquest and possession, with the purpose of bringing order, whether benign or repressive, to regions regarded as dangerously unstable, quelling unrest at its source by deploying armed forces funded directly from the local economy, or sucking away economic activity in order to build up the conqueror at the expense of the conquered.

All these military options are unattractive. They are unattractive in themselves because they offend the liberal conscience; they are unattractive also because they are counter-productive. All Western powers now have significant and growing Muslim populations living within them. Militarism would of necessity inflame them and aggravate conditions further.

There is also no practical way of intervening into communities felt to be harbouring or cultivating extremism. Muslim clerics cannot be told to put their house in order; Muslim youth cannot be instructed to pay more respect to their more moderate elders. Such an idea—though frequently touted by desperate politicians—is insensitive and patronising. It cannot work; it can only backfire.

Attacks on the religious element of jihadist ideology are also unrealistic. Islamist extremism may be barbaric, murderous and medieval in too many respects, and our more foolish public figures may try to win applause by saying so, but efforts to persuade its followers of this view would be seen as insulting—and, as with all the remedies listed above, met with reprisals.

These, then, are what we cannot do. What we can and must do is establish a framework of equity between ourslves and the radicals. No dialogue is possible with an enemy de haut en bas. It is psychologically necessary to talk as equals: such is the basis of diplomacy.

But what kind of equity is needed here? Not, certainly, the equity of violence. We need, instead, to create a parallel condition to the one in which Muslims find themselves, and there is one crucial way of doing so. The flow of human traffic is currently all one way: we need to balance it with a flow in the other direction, from the Christian/secular West into the Muslim Middle East.

We need communities of Westerners to take up residence in the least functioning areas of the world, to bring Western skills and experience to bear on communities that have only ever known cultural impoverishment. We need to come out of our smug little bubbles of Facebook certainties and show the world the advantages of liberal values and education.

This is quite different from military conquest. It isn’t an attempt to take over and rule. It isn’t colonial imposition. It is merely the addition of a new cultural layer alongside existing structures, a phenomenon quite different from that which operated in the background during Britain’s days of empire. It isn’t a land grab and it isn’t an attempt to exploit cheap labour in the way that the British-owned tea plantations were in India and Kenya. It is merely the setting up of parallel communities.

Augmented Western residency in the Middle East and other Muslim states would create a level of vulnerability that would equalise the tension between Muslim migrants in the West and “us”—their Western hosts, and this is key.

Islamic State’s behaviour is disgusting but it isn’t incomprehensible. It is that of a badly behaved child—a defiant, deranged demand for attention. Many parents will recognise the phenomenon of a destructive temper tantrum in children who feel they are being ignored. IS’s behaviour is a thousand times worse but the mechanism is the same. It reflects the child’s perception of its own impotence in the face of adult strength—the fact that the indifferent adult seems to want nothing from the angry child: that the want is all the other way.

The right parental response is not to meet rage with rage. It is to offer the attention that is so badly desired, to shorten the distance between adult and child, and to make the child feel valued.

Our challenge, therefore, is to be less remote. We can only do that by getting closer. We need to enter Muslim communities, and especially Arab communities, make ourselves available, show ourselves not as Western monsters but as “others” with legitimate alternative values, and thereby help dissolve the dangerous stereotypes that exist between us.

How can this be done? A century and a half ago, when Britain was at its most expansive, the world offered havens for Westerners with no obvious place inside their home communities. Europeans travelled overseas to make new lives for themselves, often in the most dangerous and inhospitable conditions. Some failed but many succeeded. Australia was built by the exiled and self-exiling.

The traffic is now largely in the opposite direction. Many ideologists of the left see this as a necessary rebalancing of imperial abuse: we exploited the Third World and now it’s payback time. Such tit-for-tat thinking is sanctimonious. We need a way forwards, not just moral retribution.

We are vastly over-populated. Our cities are at breaking point and our infrastructure can’t cope—and shouldn’t be made to cope—with the growing numbers. London’s economic magnetism is sucking the lifeblood out of Britain’s provincial centres but also making life worse for its own poor.

Land, by contrast, is a plentiful resource in the Muslim world. Africa and the Middle East have it in abundance. Western inventiveness and entrepreneurship can find opportunities there not just to benefit itself but to improve the economic conditions and social justice of local communities.

In addition, instead of imprisoning those from our social underclass who resort to crime because our society wants nothing from them, we could be opening up new initiatives overseas that provide legitimate opportunities for resilience and non-conformism.

How could communities of Westerners survive in regions blighted by tribal warfare and political dysfunction? To some extent, their foreignness would be a form of protection: they’re not part of the local struggle. More important, the need to protect the new arrivals would mean entering into pacts and treaties, whether with central governments, tribal leaders or agencies of Islamic State, and treaties are an important first step in the process of dialogue and mutuality.

It is true that Islamicism has been paying increasingly little respect to those non-Muslims who get in its way. Christians and Yazidis encountered by IS on its expansion out of Syria and Northern Iraq have suffered terribly. So too have Shi’ites.

But this is part and parcel of IS’s barbaric bid for power and attention. In a situation where instead of challenging IS for power, that power was at least nominally respected, agreements could be entered into, precisely because the drawing up of an agreement depends on recognition—the very thing that the dispossessd crave.

Until now, no one in the West has openly talked about recognising or legitimising Islamic State. This is shortsighted. Like the Balkans, the Middle East is wracked by tribal and religious division. Yugoslavia was held together by Tito, mostly to the benefit of the Serbs; Iraq, similarly, was held together by Saddam, mostly to the benefit of Sunnis. In both cases, however, in spite of gross violations of human rights, the basic aparatus of state functioned in ways we recognise and we were right to do business with them.

However horrific, Islamic State can be addressed in the same way—and must be, if its brutalising instincts are to be realigned. Members of IS are, after all, by no means as pious as their public relations machine likes to suggest. There are overwhelmingly made up of young people who want to be winners in the world, not losers. The point about their adherence to IS is that it is the product of motivation. They want.

There is another reason for wanting to see a build-up of Western communities in the Muslim world. It’s all very well for immigrants to complain about their treatment as new arrivals in Europe, but it would be an object lesson to see how European settlers would be treated in Muslim countries. Would Westerners enjoy better rights—not just of residency and freedom of thought, worship and movement but of welfare, health and education—than those of Muslims here?

There are always calls for reverse discrimination in favour of disadvantaged groups in the West, and these are invariably met with opposition especially by the least successful members of the dominant group who, not unreasonably, feel that their own needs should be privileged.

If we can learn from the Muslim world how better we can accommodate outsiders, then that would be a worthwhile cultural transaction. Equally, if Muslim states cannot reciprocate with the even most basic range of rights and benefits that its people enjoy when they come to the West, there is an argument for saying that the West has grounds for reviewing its own policies on immigration.

But that should all be up for negotiation. First, the negotiation has to begin.