What motivates someone to be violent? This is a question many people are asking in the wake of the recent mass shootings in California. Most explanations tend to revolve around the core assumption that violence is wrong. If someone is violent, something must be broken in their moral psychology—they are intrinsically evil, they lack self-control, they are selfish, or they fail to understand the pain they cause. However, it turns out that this fundamental assumption is mistaken. It is not the breakdown of their morality at all, but rather the working of their moral psychology. Most violence in the world is motivated by moral sentiments.

I began studying this issue by asking why people disagree when and if violence is appropriate. Intergenerationally, I looked at why spanking children was more acceptable 50 years ago than today, and why it is still more acceptable in certain parts of the country. Cross-culturally, I looked at why it is incomprehensible to Westerners to kill women for sexual infidelity, yet other parts of the world encourage this practice.

Most violence in the world is motivated by moral sentiments.

To find answers, I looked at violence across cultures and history with my colleague Alan Fiske of the University of California, Los Angeles. We analyzed records of all kinds of violence, ranging from war to torture to genocide to homicide. While this was rather depressing work, it also led to some very interesting findings. We identified a pattern in that violence that was both predictive and explanatory.

The commonality was that the primary motivations were moral. This means that the perpetrators of violence felt like what they are doing was morally right. In fact, when they were committing the act, they perceived that not acting would be morally wrong. It wasn’t about a breakdown in moral sensibilities, but more that their sense of morality was different. They viewed violence as the fundamentally right thing to do even if no one else could see any possible justification for it.

With this lens, let’s go back to that spanking scenario. A child disobeys his mother, who spanks him because she believes it is her duty to protect him from himself and ensure that he becomes a responsible adult. She sees it as her obligation as a parent.

Similarly, drill sergeants and gang leaders often haze new recruits, as they believe it is their duty to create lifelong bonds and instill obedience, which are required in battle. We can even see this mentality with terrorists. ISIL members believe they are morally justified and obligated to commit acts of terror, while US soldiers accept some loss of civilian lives to achieve the deaths of those terrorists. In all of these scenarios, the violent act is perceived by the perpetrator as virtuous. As details emerge about the California shootings, we will begin to see more about the shooters; whether they felt their violence was something they had an obligation to do, and if so, why.

The general pattern we saw in the cases we studied was that violence was intended to regulate social relationships and sustain a moral order. The perpetrators are in control of their actions—they know they are hurting fellow human beings, and that is exactly what they intend to do.

An interesting question is whether people feel good about committing these acts of violence.

An interesting question is whether people feel good about committing these acts of violence. The clear answer is that people generally do not like hurting others. Like many moral practices, such as standing up for what is right or telling the truth, it can be very upsetting to commit violence, and even require special training and social support. Think about someone who jumps into icy water to save a drowning victim. It’s the right thing to do, but most of us wouldn’t enjoy it.

So how does this knowledge that violence is morally motivated help in our efforts to reduce it? It shows that we need to carefully reconsider our strategies. For example, we’ve been trying to decrease gun violence for years with increased mental health checks. While that is a good thing, it will not significantly decrease gun violence because most gun violence is not committed by people with mental health problems. Rather, it is committed by people who feel they are morally right in committing that act.

We also can look at body cameras worn by policeman in an effort to decrease police brutality. The theory is that if police know they are being observed then they are less likely to commit brutal acts. The premise is that people are less likely to engage in acts they know are wrong when they are being watched. But what if the police officer feels he is morally right in committing that act? Will being filmed deter him from doing what he feels is his duty?

While the data is still out on body cameras, it is interesting to note that some communities using them have also seen a big push to change the moral rules so that everyone knows it is not acceptable to be aggressive with civilians. That push by the community to change the moral standard seems to be the key to decreasing all kinds of violence. We have to make it immoral within a culture. There are interventions we can do at the psychological level, but a lot of the work falls under social structure changes like giving people more opportunities, reducing inequality, and increasing stability.

The good news is that violence is changeable and is changing. Historically, the global rate of violence as a percentage of the population is decreasing. The motives for violence will continue to exist, but we can work for more peaceful responses.