A fighter for the Islamic State in Mosul, Iraq, in 2014. (Reuters)

Luke Glowacki is a postdoctoral fellow in human evolutionary biology at Harvard University.

From Brussels to Paris to San Bernardino to Syria, the world appears to be erupting in violence. In this war, the targets can be anyone and anywhere. While attackers take inspiration from Islamic State leadership, in many cases they seem to act on their own initiative. In Syria, the Islamic State carefully stages theatrical acts of barbarity to create terror and awe around the world. Is this a new kind of war?

Only through the short view of modern history does this type of war look new. Public displays of brutality have long been used to terrorize and subdue populations around the globe. The theatrics of the Islamic State pale in comparison to those seen in Europe just a few centuries ago. Burning alive, drawing and quartering, drowning, garroting, disemboweling or breaking on the wheel were all common methods of dispatching criminals, enemies and those who ended up on the wrong side of a theological debate.

Even in the United States, executions were historically public affairs. At one of the last public executions in the United States, in 1936, at least 20,000 people turned up to watch. The city of Owensboro, Ky., built a gallows 25 feet tall. Bars were packed while “merrymakers rollicked all night” and many homes had “hanging parties.” The New York Times reported that when the body fell, “souvenir hunters rushed forward . . . and tore the black hood . . . off his head before he had been pronounced dead.”

Where does this capacity for horrific violence come from? My colleagues and I have been studying the origins of war through systematic analysis of chimpanzees, hunter-gatherers and modern conflicts. We have learned that lethal violence against out-groups is found, in one form or another, at all scales of society, including among our closest relatives, the chimpanzees.

In a pattern that disturbingly resembles human warfare, chimpanzees across East Africa regularly kill members of neighboring groups, including infants and females. Sometimes these attacks cause the extermination of entire communities, a phenomenon akin to genocide in human society. When this happens, the successful group takes over the territory of the defeated group, gaining access to valuable resources.

What about the traditional human societies, such as hunter-gatherers, that best represent our prehistoric past? Using ethnographic and historical documents, my Harvard colleague Richard Wrangham and I found that for most of human history, societies generally carried on some form of war with neighboring groups, even when the people spoke the same language and looked like them. Although there are well-documented cases of hunter-gatherers living peacefully with their neighbors, these are the exception rather than the rule. Such groups usually gave up violence after coming into contact with more powerful neighbors.

Like the terrorist attacks of today, these conflicts generally targeted members of a perceived enemy group, commonly including women and children. The bodies of victims were frequently mutilated with a creativity that the Islamic State would find astonishing. Entire populations and ethnic groups were wiped out. This type of violence stretches deep into our prehistory. Evidence of the first prehistoric massacre dates to more than 13,000 years ago, well before the invention of agriculture.

What explains how people can commit such violent acts? One answer lies in our psychology. Humans are hard-wired to adopt their communities’ norms, and these norms can include rules for how to treat others — including whether to tolerate differences or attack outsiders. When norms provide status, material rewards or membership in a privileged group, they become even more potent.

Cultures are able to hijack this psychology for violent ends by providing status, promises of an afterlife and a sense of meaning. People belonging to communities that advocate violence will adopt norms of violence, whether those communities are tribal societies, neighbors and family, or Facebook friends. Cross-cultural research I’ve conducted shows that the most important predictor of warfare in a society is a cultural system that awards warriors with social benefits.

In East Africa, where groups battle each other for livestock, access to grazing lands and water, conflicts are fought with modern weapons such as AK-47s but occur along tribal borders and resemble the dynamics of ancestral warfare in important ways. Access to resources such as livestock and water can be critical for a group’s survival, and so these cultures award status and livestock to successful warriors. Such warriors are able to marry more wives and have more children than other men. Half a world away, in the Venezuelan Amazon, researchers found that warriors also ended up better off than non-warriors. Over the time scales at which humans and cultures evolve, benefits such as these may have had profound significance in the development of human behavior.

Such incentives help explain how people can be lured into supporting the Islamic State. The group promises its recruits prestige, a sense of community and the possibility of glory — the same types of incentives that cultures across the globe have historically used to motivate youth to take up arms.

The difference between tribal societies and the modern world is that now social media makes it possible for isolated individuals to adopt the values of a movement halfway around the world. A Detroit teenager can be more connected to his Twitter followers in the Levant than to his peers at school. If his peers overseas advocate violent jihad, it is not surprising if he eventually considers it, especially if it comes with promises of fame and glory.

There is nothing historically unique about the type of war the Islamic State is waging, but the diffuseness of contemporary social networks presents a new challenge. What is clear is that countering the Islamic State will require creating cultural values that can compete with the community, glory and meaning the Islamic State offers its recruits. Can we engineer an alternative that makes supporting democratic values and tolerance of others as alluring?