By comparison with most other parts of the world, western Europe is a very peaceful place and is getting more peaceful by the year. Homicide rates for Britain, France and Germany are among the lowest of any countries in the world; those in many parts of northern Europe are even lower. One of the primary reasons why people from much more troubled parts of the globe seek to come to western European states like ours is precisely because they are so stable and safe. That reputation is solidly based and durable. In the early 2000s, Norway regularly had around 30 homicides a year (the United States, by comparison, had about 15,000). Then, in 2011, Anders Breivik murdered 77 people in and near Oslo. Yet, in the years since then, Norway’s homicide count has fallen back to around 30 a year once more.

Context is however no consolation to those who have been, or who could have been, or who knew or loved, the victims of the attacks on civilians that have made western Europe a more fearful place in recent weeks. Friday’s attack in Munich, when an 18-year-old German-Iranian student turned his gun on innocent victims in a shopping-mall, many of then also teenagers, and killed at least nine of them, is the latest. It will probably not be the last. But it comes hard on the heels of the axe attack on a commuter train in Würzburg by an apparently 17-year-old male refugee from Afghanistan, which left five injured, two of them very seriously, and of what seems like a failed abduction attack at knifepoint outside an RAF base in Norfolk a day later. It is only two weeks since a 31-year-old Tunisian immigrant drove a heavy truck into crowds celebrating Bastille Day on the seafront in Nice, killing 84 people.

All such indiscriminate attacks on strangers involve different stories. The Munich killer was apparently a bullied introvert who was fascinated by the Breivik case, planned his spree and boasted of his Germanness to his victims. By contrast, the Würzburg attacker invoked Allah and was said to have been inspired by Islamic State (Isis) to attack train passengers. In yet another difference, the Nice truck driver now appears, unlike the two in Germany, to have had accomplices in an attack for which responsibility has been claimed by Isis. Like the Munich killer, he also had a record of psychiatric problems. It is little wonder that the authorities cannot decide whether these attacks were politically or religiously motivated, or whether they are more similar to a narcissistic school or college attack of the kind so grimly familiar from the United States. In each case, moreover, the facts may change as investigations reveal more.

Yet all of these attacks have a common and cumulative effect. All raise genuine fears about wider personal safety. All fuel a more alarmist public mood and debate. In part, that is because they are so random, never directly provoked by the victims, except in the psychosis of the attacker. In part, it is because they often have radical Islamist terror connections or echoes, though not apparently in the Munich case, which plays into anti-immigrant fears.

But it is also nuanced by the fact that the countries in which such attacks take place have such different traditions and moods. France, under a politically weak president, is battling with the legacy of empire, a secular republican ethos and its recent military interventions in Africa. France has also suffered a succession of terrorist attacks including the Charlie Hebdo and Bataclan assaults. Germany by contrast has a generally trusted chancellor, has kept out of military interventions, has a tradition of tolerance, though not a good record on integration, and operated a temporary open-door approach to refugees and migrants at the height of the Syrian crisis. It had also suffered less, until recently, from such attacks.

Yet the threat is perceived to be a common one; in some respects rightly. Millions of people in Europe, including in Britain, will look at a shopping mall shooting, a sudden attack on a train or a murderous truck assault and imagine such things happening in their communities too. That is why, while keeping these threats in perspective, governments have to take necessary preventive measures.

But the same millions can also imagine, all too easily, a backlash against foreigners and migrants. Europe’s populist, anti-immigrant and law-and-order parties were already growing stronger on the back of economic stagnation. Random acts of violence only feed that fear. But governments, like the rest of us, must hold their nerves and not make an already bad situation even worse.