A healthy aversion to snakes might be useful in the jungle, but a ramped-up phobia of them that has you running screaming from garden hoses is obviously maladaptive in suburbia. And then there are phobias that seem to lack rational explanation: an aversion to pigeons, avoiding anything to do with the number 13, to fear of the color yellow.

"Fear mechanisms have helped us survive for millions of years," says UC Davis neuroscientist and psychologist Philippe Goldin. But even a natural mechanism can become twisted into something strange.

Where fear lies

The primary seat of fear in the brain lies in the amygdala, two almond-shaped clusters of neurons nestled deep in the temporal lobe. Scientists have found that there are actually two fear-related pathways involving the amygdala — one more direct route from a stimulus, and another, longer way that first passes through the cortex, where much of your higher-order thinking happens.

Either way, tripping the amygdala's alarm "puts you in a mode where you are prepared for action," says Nouchine Hadjikhani, a Harvard University neuroscientist.

(More from World Science Festival: Life in the universe: An optimistic cosmic perspective)

Registering a fear-causing stimulus can happen at lightning speed; Swedish scientist Arne Ohman and colleagues have found that flashing images of snakes or spiders so quickly that people are not consciously aware of seeing a snake or spider can still trigger a fear response. Interestingly, when these high-speed stimuli flash by, people's amygdalas respond equally fearfully to all stimuli — so an arachnophobic person would be equally unnerved by images of spiders and snakes. But when the images are shown slowly enough for people to comprehend them, their amygdala lights up only in response to their specific phobia (spiders, say). Our amygdalas seem to be primed to react quickly to anything that seems threatening, but once there's enough time for other, more sober parts of the brain to weigh in, we can filter out what's not worth getting worked up about.

The pathways leading out of the amygdala lead to lots of other brain regions; one particularly important output for the fear response is the connection to the hypothalamus. This brain region regulates the production and secretion of hormones like adrenaline, a key player in the fight-or-flight response. "The amygdala is one of the most highly interconnected regions of the brain, and that makes sense," Goldin says. "Arousal — positive or negative — activates many different mechanisms."

But there are other brain structures involved in fear, too, as demonstrated by studies of people with a rare genetic disorder called Urbach-Wieth disease, which causes the amygdala to shrivel up. In experiments conducted by University of Iowa researchers, Urbach-Wieth patients were unmoved by horror movies or exposure to large spiders, but did experience terror when they were asked to inhale a carbon dioxide mixture through a mask — which simulates suffocation. Therefore, there must be some amygdala-independent fear pathway; further research is needed to trace that trail through the brain.

(More from World Science Festival: Everything you need to know about Ebola)

How fear takes hold: Through direct association

Just as Pavlov's dogs salivated at the sound of a dinner bell, the power of association can turn even the most relatively innocuous thing into a phobia. Scientists are able to induce phobias of certain sounds or smells in lab rats by administering a painful shock in conjunction with that stimulus. Eventually the rodents are hard-wired to associate that scent or sound with pain, and remain fearful of that trigger.

How fear takes hold: Through indirect association

The process of how phobias form by association in humans is, of course, more subtle than a guy in a lab coat tormenting you. University of North Dakota psychologist Ric Ferraro invites you to consider someone with a phobia of the color green — how could something like that have formed? Any number of ways; it could have been that, as a child, "they could have fallen down, got green grass on their clothes, and their mom or dad yelled at them so now they associate fear with the color green," Ferraro told the UND news service.

How fear takes hold: Through fear transference

There's also a social component to some human phobias. We learn a lot of our behavior through observation, and this includes fear: "You see your mother panicking frantically in response to a wasp when you're a child, you'll likely be afraid of wasps too," neuroscientist Dean Burnett wrote in the Guardian.

How fear takes hold: Through instruction

We may even convince ourselves that something's incredibly scary thanks to receiving information (whether true or false) that something is threatening, a uniquely human phenomenon called instructional fear acquisition. A team led by New York University researcher Elizabeth Phelps found that if a person is told they might get a shock when a square of a certain color flashes on a screen, their amygdala will activate even without the shock, possibly because the brain creates an abstract representation of the pain. In a more real-world setting, instructional fear acquisition could be the reason you get the urge to avoid showers or flocks of birds after seeing a Hitchcock film.

How fear takes hold: Through inheritance

Another, less-well-understood factor in our fear is epigenetics — heritable changes outside of the changes to our genetic code. Goldin thinks that epigenetics could potentially explain a lot of the variance among people in terms of how they respond to and control their own fears.

(More from World Science Festival: 5 great scientists who never won a Nobel Prize)

"You have had, from birth to this moment, this whole trajectory of learning that sculpts your brain," Goldin says. "In addition to that, there's genetic factors that come from your mom and dad and beyond, even your grandparents, great-grandparents…things that happened to them are influencing what parts of your genetic code are or are not activated."

Evidence bears this out: In 2013, researchers published a paper in the journal Nature Neuroscience about an experiment in which they trained mice to associate the smell of the compound acetophenone (an odor another researcher describes as something like orange blossoms plus artificial cherry flavor) with pain. The scientists then saw that the offspring of those mice showed more signs of agitation and fear at the scent of acetophenone than control mice.

What can be done to fight the fear

Though fears can stem from many different sources, therapy can help undo the psychological knots of phobias. The treatment of choice these days is exposure-based cognitive behavioral therapy, in which a person works with a therapist to unlock the thought patterns underlying their fears, and also gradually learns to tolerate exposure to the phobic stimulus. An arachnophobe may talk about the realistic level of danger that spiders actually pose, then look at pictures of spiders, then get closer and closer to an actual spider.

So, if you shudder at snakes, pale at the sight of pigeons, or come undone when a clown honks his malevolent horn, don't despair. Your brain might be wired for fear, but it can be rewired just the same.