As information flowed in on Sunday about the deceased Orlando mass-shooter Omar Mateen, a battle of narrative was playing out in the media: Was the Orlando killer a terrorist with a deep ideological commitment to radical Islam, or a mentally unstable hater with no real ISIS links? Some seized on the fact that Mateen made a call to 911 moments before the massacre to pledge allegiance to the head of ISIS as proof that this was an example of organized Jihadist terrorism. But Mateen’s family emphasized personal factors: His ex-wife cited his mental instability, evident in the domestic violence he inflicted on her, while his father said that Mateen was acting out of a deep hatred for LGBT people, and in particular gay men.

In the face of such mind-numbing violence, it’s natural that we search for an all-encompassing explanation, whether it take the form of lax gun control (or conversely, no “good guy with a gun” to stop the shooter), poor mental health care, or jihadi ideology. But events never have a single cause; rather, they emerge from the weave of various causes. Moreover, in terms of judging the horror in Orlando, it little matters which cause is dominant. This was unquestionably an act of terror, whether or not it fits the FBI’s precise definition: The shooter targeted gay people for being gay in a gay public space. Is is undeniably an act of political violence.  

The explanations being proffered for the atrocity shouldn’t be seen as mutually exclusive, but rather as mutually reinforcing. Unlike earlier terrorist groups such as Al Qaeda, ISIS has shown little aptitude for creating terror cells that infiltrate the West. Improved counter-terrorism measures since 9/11 have been successful in disrupting this tactic. Making a virtue of necessity, ISIS has adapted to the new environment with a novel technique: using social media to incite lone wolves who are given not specific plans but rather a general mission to wreck havoc. Not surprisingly, ISIS has found that the most vulnerable recruits are alienated and troubled souls, who often turn to extremist violence to give meaning to their chaotic lives.

As Heather Hurlburt, a foreign policy expert at the New America Foundation, explained to me in a 2014 email interview, the Islamic State “seems to calculate—correctly, in my view—that small-scale lone-wolf attacks on symbolic targets will get it outsized attention. So you see these propaganda broadcasts encouraging individuals who may be mentally unstable, who may have had little or no actual training, to use weapons like knives and cars that will surely lead to the attackers’ capture or death. The propagandists seem to understand the link between certain forms of mental illness and susceptibility to mass violence, even if we don’t.” As it happens, ISIS released a message last month calling for attacks during Ramadan, which began last Sunday.

Omar Mateen certainly seems to follow this pattern. One of Mateen’s co-workers told Miami Herald reporter David Ovalle, “He would never have more than 3 or 4 sentences without using the word n****r or queer or dike. It was always about violence.” 

Before his public violence, Mateen had a history of domestic violence. “He was not a stable person,” said his ex-wife to The Washington Post (which decided to preserve her anonymity). “He beat me. He would just come home and start beating me up because the laundry wasn’t finished or something like that.” During their marriage in 2009, she said Mateen showed no signs of being religious. This is echoed by Mateen’s father, who said his son was angered by the sight of gay men kissing, and that this “has nothing to do with religion.”

While Mateen might not have been particularly pious, his behavior falls into a pattern of other troubled individuals who have turned to Islamic State ideology such as Man Haron Monis (who took hostages, two of whom died, in Sydney in 2014) and Michael Zehaf-Bibeau (who killed a Canadian soldier that same year). These were men with a history of personal violence and instability, with only insubstantial internet ties to the Islamic State, who were activated by social media messages into re-fashioning themselves as lone-wolf terrorists.

A simplistic model of causality posits that extremist ideology leads to violence. The reality is more complex: People with a proclivity toward violence are often drawn to extremist ideology, so the linkage is reinforcing; it’s not just ideology driving behavior.

For violent, disturbed individuals, the grand scope of an extremist ideology can offer a way of turning their personal turmoil into something grander and more meaningful, a way of playing a key role in the making of history. This was the role anarchism played in the life of Leon Czolgosz (who assassinated President William McKinley in 1901) and Marxism in the life of Lee Harvey Oswald (who killed President John F. Kennedy in 1963).

The intersection of mental-health problems with political violence has real implications for how the struggle against terrorism should be framed, and for the proper mix of policy responses. It suggests that heightening the language of ideological conflict—as Donald Trump is doing with his talk of banning Muslims and killing the families of Muslim terrorists—is worse than counter-productive: This sort of inflammatory language is likely to make Islamic State ideology even more attractive to the alienated and troubled.

Conversely, because mental health and political violence are intertwined, an effective counter-terrorism program cannot just be a law-enforcement effort; it has to include a way of reaching out to vulnerable populations. Immigrant communities, like the one Mateen grew up in as the child of Afghani immigrants, tend to be under-served by mental health professionals.

“Enormous effort has gone into theorizing about who is most vulnerable to online or remote radicalization, and how they can be identified,” Hurlburt notes. “Some of the efforts, such as surveillance of college students’ social media accounts and police informers in mosques, have been controversial and counter-productive. Insights from mental health, especially post-Columbine, suggest more community-centered efforts, focused on giving family and clergy tools and non-stigmatizing places to turn for help—and making sure their concerns are heard.”

If we want to prevent future massacres, a mental-health framework has to be a key part of the solution no less than other policy initiatives such as gun control and counter-terrorism. Horrific events like the Orlando massacre never have one simple cause.