scream drew barrymore Woods Entertainment / Dimension

Every Halloween, people flock to haunted houses, dress up as terrifying ghouls, or curl up on the couch with a few horror movies.

The compulsion to scare oneself for fun seems counterintutive, but it shows up across most cultures. So why do some people do it?

It turns out it's all about how fear is experienced — though, of course, not everyone feels the same about it.

1) People who like being scared may feel rewarded by it.

There's evidence that people who enjoy watching horror movies have brain chemistry that differs from people who would rather not spend an evening binging on "The Exorcist" and "Evil Dead," according to psychiatrist David Zald.

Dopamine is responsible for feelings of accomplishment and rewards, but it's also been linked to averse emotions like fear and dread, according to a 2008 study from the University of Michigan.

Zald's research at Vanderbilt University expanded on how dopamine works with fear, and found that those who enjoyed fearful or risky situations tend to have brain cells that aren't able to regulate their brain dopamine release as well — so their brains end up soaking in dopamine for longer periods of time, according to National Geographic.

In other words, they tend to get more out of being scared out of their gourds because they end up with higher levels of dopamine.

haunted house Rick Wilking/Reuters

"Think of dopamine like gasoline," Zald told the National Geographic. "You combine that with a brain equipped with a lesser ability to put on the brakes than normal, and you get people who push limits."

Adrenaline, which is also released during dangerous moments, is also perceived as enjoyable by some — hence the term "adrenaline junkies" for people who love skydiving and other extreme activities. According to National Geographic, "the chemical release generates a feeling of exhilaration that continues after the threat has passed ... for some people, that adrenaline rush can become a reward the brain seeks."

2) Emotionally intense situations are more memorable and can bring people together.

People have been telling scary stories around the campfire for a long time. But fear, rather than scattering people screaming into the night, might actually make them huddle closer together.

Intense fear, when experienced with other people, can be very memorable, according to Margee Kerr, a sociologist at Robert Morris University and Chatham University.

"We build a special closeness with those we are with when we're in an excited state, and more important, that it can be a really good thing," Kerr told the Atlantic. "We're social and emotional beings — we need each other in times of stress, so the fact that our bodies have evolved to make sure we feel close to those we are with when afraid makes sense."

3) But it has to be the right kind of fear in the right place.

The fun of Halloween is that you can experience the thrill of fear without any real threat. Kerr, who studies what scares people at a Pittsburgh haunted house called Scarehouse, and a new pet project called The Basement, told the Atlantic that there's a limit to how fear can be safely experienced.

13th floor haunted house A group of girls react to a live actor character. REUTERS/Rick Wilking

"It's all about triggering the amazing fight-or-flight response to experience the flood of adrenaline, endorphins, and dopamine, but in a completely safe space," Kerr told the Atlantic. "Being scared lost in the woods alone with no help in sight — bad; being scared lost in a haunted house with your friends, with professionals no more than twenty feet away ready to whisk you out of danger — good!"

The thrills of a haunted house or a scary movie can also provide a boost of self-esteem, Kerr said.

"Lots of people also enjoy scary situations because it leaves them with a sense of confidence after it's over," she told the Atlantic. "Think about the last time you made it through a scary movie, or through a haunted house. You might have thought, 'yes! I did it! I made it all the way through!' "

So if you're a fan of the macabre, go all out. You might make some friends, and feel a lot better about yourself.