Even though our risk of dying in a mass shooting is low, we may still fear it more than deadlier hazards like car accidents.

When faced with an armed attacker or a wild animal, fear can be a good thing.

Fear prompts an alert to immediate danger and primes the body to respond in a way that provides protection from that danger.

But as creative creatures, humans also have the ability to anticipate future threats.

These feelings may be triggered by the memory of a traumatic event or something in the environment, like a dark alley or the way someone is dressed.

Sometimes, though, alertness can grow out of control, morphing into anxiety or fear that outpaces the actual risk of danger.

In the past, people may have feared tornadoes whenever the sky darkened, or animal attacks while walking alone in the forest.

These days, fears are just as likely to be related to recent events like the attack at the Pulse nightclub in Orlando, or the San Bernardino shooting.

“Terrorism and mass shootings have, for now, become part of a ‘national anxiety,’” Daniel Antonius, Ph.D., an assistant professor of psychiatry at the Jacobs School of Medicine and Biomedical Sciences at the University at Buffalo, wrote in an email to Healthline.

Read More: More experts approaching gun violence as a public health issue »

By itself, fear is not a bad thing.

But when it is out of sync with the actual risks, fear can negatively shape decisions and behaviors.

Taken to the extreme, fear can even cause shutting off from the world.

This is not to say that the world may not be dangerous.

But the dangers may not be what they really seem.

“People are far more likely to be the victim of a property crime or a very traditional street crime than they are to be the victim of an incident of mass violence or terrorism,” Joseph Schafer, Ph.D., a professor of criminal justice at Southern Illinois University, told Healthline.

So how likely is it to die by a mass shooting or terrorist attack?

According to research by The Washington Post, 869 people have been killed in mass shootings in the United States since August 1, 1966.

This includes shootings in which four or more people were killed by one or two shooters. It excludes shootings related to gang violence, as well as those that started as other crimes or involved only the shooter’s family.

Those shootings are a small fraction of the overall number of gun-related deaths. In 2015, of the 25,000 gun-related injuries in the United Stated, 12,000 resulted in death.

Of those, 39 were from mass shootings.

The National Safety Council puts the lifetime risk of being killed in the United States by any assault with a firearm at 1 in 358.

The lifetime risk of dying in a mass shooting is around 1 in 110,154 — about the same chance of dying from a dog attack or legal execution.

There is a three times greater chance of dying from a sharp object than from a mass shooting. The chance of dying from lightning, though, is lower.

In fact, there are many more likely ways to die than in a mass shooting.

Heart disease and cancer are at the top — the risk of dying is 1 in 7. And even dying in a motor vehicle crash is higher — 1 in 113.

And what about terrorist attacks?

Another report by The Washington Post found that in the years following the Sept. 11, 2001 attack, the risk of dying in a terrorist incident is less than the risk of being killed by falling furniture or a TV.

Read More: Why gun violence is a public health issue »

Even though the risk of dying in a mass shooting or a terrorist attack is low, real fears are rooted in actual events.

“There is a spike in general psychiatric symptoms and disorders after a terror attack, and there is a spike in general fears of future attacks,” said Antonius. “The psychiatric symptoms disappear relatively quickly — within months — but the underlying fear can linger for years after the attack.”

The severity of fear is partly related to where someone was during an attack.

After the terrorist attacks of September 11, 2001, people living in New York City experienced greater levels of post-traumatic stress disorder (PTSD) than those in other areas of the country.

But the extensive media coverage that follows traumatic events means that even people not directly connected to the event may develop fear or anxiety in response.

“The amount of TV coverage of the attacks being watched is associated with elevated rates of post-traumatic stress disorder,” said Antonius.

One group of researchers found that, following the 2013 Boston Marathon bombings, people who were exposed to repeated media coverage of the attack, but were not directly involved, reported high levels of stress.

The researchers suggest that seeing or hearing news related to an attack several hours a day might prolong the stress reaction triggered by the initial “collective trauma.”

It’s difficult to know the exact link between media coverage of an attack and people’s fears, but the content that people watch may matter.

“We do tend to see that people who have greater exposure to different types of news media, as well as people who view more crime dramas, tend to express higher levels of fear,” said Schafer, “but it’s not clear which is causing the other.”

People may develop anxiety from watching the news, or people who are anxious may watch the news in order to calm their worries.

News media can also skew the perception of how frequent these events are.

Compare the coverage of a mass shooting to the number of reports about people dying from other causes.

Read More: PTSD can last for years in people who witness traumatic events »

Even without the influence of the media, we are not always very good at knowing what is most dangerous in our environment.

“People are not good at estimating actual risk, especially ‘emotionally charged’ risks,” said Antonius.

This is as true for traditional crime as it is for mass shootings.

“We tend to see, across the board, that people’s actual risk of victimization and their fear of crime tend to be disconnected from one another,” said Schafer, “but it’s not in a consistent way.”

Age plays an important role in how people determine — or fail to determine — what is most dangerous.

Young people tend to underestimate risks, even though they are more likely to be victims of crime and violent crime. Middle-aged and older adults, on the other hand, have a moderate amount of fear even though their risk of being a victim is quite low.

In addition to watching the news, our brains can shape how we react to traumatic events.

Dreading an event, like a mass shooting, may feed our fears. But some research has also shown that when people have more control over a situation, they tend to view risks more optimistically.

For example, dying in a motor vehicle accident is more likely than being killed in a plane crash, but flying means giving up control of safety to the pilot, which can feed fears.

Emotions can shape perceptions of risk and also responses to threats.

“In the context of anger, people tend to exhibit greater levels of optimism and sense of control — and preference for confrontation,” said Antonius, “whereas with fear comes greater pessimism and negativity — and preference for using conciliatory measures to de-escalate conflict.”

While for some people the stress and anxiety that follows a mass shooting or terrorist attack can interfere with their daily lives. But for many more their innate survival mechanisms kick in when they need them.

“Most people respond to threats of future terrorism — terrorism fears — in a rational and constructive manner,” said Antonius. “We have, as humans, this innate resilience that helps us move on.”