In case you missed it, last night at the Oscars, actor Will Smith slapped the bejesus out of comedian Chris Rock, who was one of the award show’s presenters.

If you’ve ever watched the Oscars, you know that comedians are expected to make the atmosphere a little less stuffy by roasting the audience. And remember, the audience is full of insanely rich and beautiful celebrities, so an aim of the roasting is to bring these pop culture gods back down to Earth. You can think of celebrity roasting as a sort of civic duty for comedians.

That being said, Chris Rock arguably went over the line when he made a joke about Jada Pinkett Smith’s short haircut, which apparently is to hide her alopecia, an autoimmune disorder that makes you lose your hair. Rock said he was looking forward to seeing Pinkett in “G.I. Jane 2,” a reference to a 1997 movie that famously starred a bald Demi Moore, who played a female soldier in the film. I am not sure whether Rock knew that Jada had a condition or if he thought she was just sporting short hair—which she has done in the past with stunning beauty—but if he did not then Will Smith owes him an apology.

However, it is quite possible that Rock did in fact know and chose to go there anyway. After all, another duty of the comedian is to push the limits of what society can tolerate. But when you decide to take up that duty, there’s a certain amount of risk that comes along with it.

Will Smith may have not been justified in doing what he did, but all of us who have lost our tempers at some point in our life can sympathize with the man. That being said, I do not condone Smith’s response, but as a neuroscientist, I know why it happened, and it is called “amygdala hijack.”

To truly understand why Will Smith snapped, we have to understand the role and interplay of two brain areas—the amygdala and the prefrontal cortex.

The amygdala is a region of the brain that is activated when we perceive something to be threatening. For example, if someone is shown a video of an attacker coming at them, functional brain imaging would show that the amygdala “lights up,” thus it is associated with the “flight or fight” response. If this neural structure is activated by some stimulus—such as a perceived attack, physical or emotional—then the individual may experience a strong urge to attack in response. This is called amygdala hijack, and that is basically a technical term for “losing your sh*t.” Think of it as the fear center controlling your behavior.

The prefrontal cortex, on the other hand, is the brain region responsible for suppressing the reflexive behavioral response that is triggered by amygdala activation. A function of the prefrontal cortex is to regulate our emotions and control our urges. When the fear response kicks in, the front of the brain assesses the situation and modulates our actions accordingly. Amygdala hijack may induce a violent response, but if the prefrontal cortex does its job, the individual should be able to self-correct before the behavior is executed.

So, when Will Smith perceived Chris Rock’s joke as a threat to his wife’s emotional well-being, it is not a surprise that he did what he did. His amygdala temporarily hijacked his cognitive system, and for whatever reason, his prefrontal cortex was not able to override his automatic behavioral response in time. And if he had been drinking that night, then his prefrontal cortex might have been inhibited to some degree.

Interestingly, the video reveals that at first Smith was laughing at Rock’s joke, so it is likely that Smith’s amygdala was triggered later, when he saw his wife’s sad and upset expression. Who knows how she has been dealing with the emotional toll that alopecia takes on a person, and more so a female actor who is constantly being judged by her appearance. This likely activated his mirror neuron system, which in turn produces feelings of empathy.

Now that we have an understanding of the neuroscience and psychology at play in last night’s altercation, we can ask whether Will Smith was right or wrong in his actions, and whether he should be forgiven and allowed to attend future Oscar ceremonies.

To answer that, we must understand that sympathizing or empathizing does not mean justifying or condoning. I personally do not believe Smith was justified in physically attacking Chris Rock for doing what comedians are pretty much expected to do, even if the joke was cruel. As mentioned, without knowing if Rock knew about Pinkett’s alopecia, it is hard to judge whether Rock deserved what he got; but even if he did know, I still do not think a violent response is acceptable. Part of being a civilized human being is reining in our emotions, and inhibiting our violent instincts.

At the same time, I can understand why Smith did what he did, and can see myself responding similarly under similar conditions, and regretting my actions similarly. This was not the first time that the Smiths have been a target of Rock’s Oscar roasting. In 2016, he compared Jada Pinkett’s decision to boycott the Oscars due to a lack of diversity to Rock’s boycotting of Rihanna’s panties: “Jada boycotting the Oscars is like me boycotting Rihanna’s panties. I wasn’t invited!”

In addition to amygdala hijack, the Smith’s might have been anticipating an attack from Rock at some unconscious level, so in a sense Will might have been primed for such an event. Priming refers to when “exposure to one stimulus influences a response to a subsequent stimulus, without conscious guidance or intent.” Similarly, Rock’s cool-headed response may also be a sign that at some level he was anticipating the possibility of some explosive reaction from one of the two Smiths.

What’s the lesson to be learned here? We can sympathize without justifying. Losing your cool means being human. Surely Will Smith’s good acts outweigh this one disappointing event. For that reason, I believe society and the Oscar committee should forgive Smith for his inappropriate actions. At the same time, Rock should also be forgiven, and invited back to the Oscars to continue his celebrity roasting. We do not want future presenters to be fearful when making fun of celebrities. Thick skin should come with the territory.

We can all learn from this unfortunate event. The next time something “triggers” you, be mindful of your response, and allow your prefrontal cortex to subdue that pesky amygdala. In doing so, you will stop yourself from doing something you’ll regret later.

Bobby Azarian is a cognitive neuroscientist and the author of the forthcoming book The Romance of Reality: How the Universe Organizes Itself to Create Life, Consciousness, and Cosmic Complexity, which is available for preorder from Amazon. His research has been published in journals such as Cognition & Emotion and Human Brain Mapping, and he has written for The New York Times, The Atlantic, Psychology Today, and Scientific American. Follow him on Twitter

The neuroscience behind Will Smith's attack on Chris Rock