You’re sitting in a crowded movie theater watching the latest horror flick, and all around you, the audience seems genuinely scared. But for some reason, their screams and gasps are punctuated with laughter. 

We usually think of laughter as being a response to pleasure or amusement—we’re supposed to laugh when we find something funny, not scary. So why do we laugh when we’re scared? 

It turns out scientists still aren’t sure what makes us laugh in seemingly inappropriate contexts—though they have some pretty compelling ideas.

Two of the most popular theories rest on the assumption that laughter is inherently social; when we laugh, we’re conveying a message to the people around us. According to scientists like primatologist Signe Preuschoft, who published a prominent study on macaque laughter, fearful laughter is an expression of submission. Macaques in Preuschoft’s study laughed or smiled when they felt threatened by a dominant macaque—their laughter was accompanied by evasive or submissive body movements. According to Preuschoft, the laughter is used to admit fear and communicate a desire to avoid conflict. 

Another camp believes that fearful laughter actually represents a denial of fear. We’re scared, but we’re trying to convince ourselves and the people around us that we’re not—that everything is okay. Alex Lickerman writes in Psychology Today, “We're signaling ourselves that whatever horrible thing we've just encountered isn't really as horrible as it appears, something we often desperately want to believe.” Lickerman calls this a “mature” defense mechanism (as opposed to “psychotic,” “immature,” or “neurotic”). He notes, “being able to laugh at a trauma at the moment it occurs, or soon after, signals both to ourselves and others that we believe in our ability to endure it.”

Others group fearful laughter with other seemingly incongruous emotional reactions, like crying when we’re happy. They argue that these incongruous responses help us regulate our emotions; crying when we’re overwhelmed with joy or laughing when we’re terrified helps balance us out emotionally. Science reporter Wray Herbert writes in The Association For Psychological Science, “When we are at risk of being overwhelmed by our emotions—either positive or negative—expressing the opposite emotion can have a dampening effect and restore emotional balance.”

In the case of horror movies, specifically, some theorists argue that we laugh because horror and humor have in their roots the same phenomena: incongruity and transgression. We laugh when something is incongruous, when it goes against our expectations, or breaks a social law (when a character does or says something inappropriate, for instance). But in another context, those same things are perceived as scary—usually when something veers from harmless incongruity into potentially dangerous territory. In Silence of the Lambs, for instance, Hannibal Lecter’s famous “I ate his liver with some fava beans and a nice chianti” line is both funny (because there’s something incongruous about him being such a “classy” cannibal) and terrifying (because, well, he’s a cannibalistic serial killer). 

Ultimately, there’s no single explanation for the phenomenon of fearful laughter. If we laugh during a horror movie, it might be because we’re responding to the incongruity of the situation as much as the “danger” it represents. We might also be trying to show the people around us we’re not scared—or prove it to ourselves. Or, maybe, we’re just straining for emotional balance by countering our fear with a few chuckles.