According to the New America Foundation, jihadists killed 94 people inside the United States between 2005 and 2015. During that same time period, 301,797 people in the US were shot dead, Politifact reports.

At first blush, these numbers might seem to indicate that Donald Trump’s temporary ban on immigrants from seven countries—a goal he said was intended to “protect the American people from terrorist attacks by foreign nationals admitted to the United States”—is utterly misguided.

But Trump is right about at least one thing: Americans are more afraid of terrorism than they are of guns, despite the fact that guns are 3,210 times more likely to kill them.

Chapman University has conducted a Survey of American Fears for more than three years. It asks 1,500 adults what they fear most. It organizes the fears into categories that include personal fears, conspiracy theories, terrorism, natural disasters, paranormal fears, and more recently, fear of Muslims.

In 2016, Americans’ number-one fear was “corruption of government officials”—the same top fear as in 2015. Terrorist attacks came second. In fact, of the top five fears, two are terror-related. And number five is not fear of guns but fear of government restrictions on guns. Fear of a loved one dying—whether by gun violence or anything else—came next.

One reason people’s fears don’t line up with actual risks is that our brains are wired by evolution to make fast judgements which are not always backed up by logical reasoning. “Our emotions push us to make snap judgments that once were sensible—but may not be anymore,” Maia Szalavitz, a child psychiatrist, wrote in 2008 in Psychology Today.

Also, fear strengthens memory, she wrote, so that one-off catastrophes like plane crashes or terrorist attacks embed in our memories, while we blank the horrible accidents we see daily on the highway. “As a result, we overestimate the odds of dreadful but infrequent events and underestimate how risky ordinary events are,” Szalavitz explained.

Risk perception (pdf) used to be based on an analytical equation: you multiply the probability of an event by the potential damage of its outcome. But Paul Slovic, a professor of psychology at the University of Oregon, understood the powerful role of emotions in decision-making and altered that equation, noting that many things affect how we perceive risk:

do you trust the person you are dealing with

control vs. lack of control (lack of control inflates risk perceptions)

is it catastrophic or chronic (catastrophic inflates risk perceptions)

does it incite dread or anger (dread inflates risk perceptions)

uncertainty (lack of knowledge about something inflates risk perceptions)

“Most people do not distinguish well between a one-in-a-thousand risk and a one-in-a-million risk,” said Mark Egan, an associate advisor at the Behavioral Insights Group in London.

Baruch Fischhoff, a decision scientist at Carnegie Mellon, said that the unpredictability of terrorism can make it scarier than something like a car crash. “Terrorism is not like motor vehicle accidents, where past performance predicts future performance,” he said. “Terrorism could change and it’s not irrational for people to react differently to an uncertain risk.”

That’s exactly what Americans did after the terror attacks of Sept. 11, 2001. People began flying less and driving more. The result, estimated Gerd Gigerenzer, a German risk specialist, was that 1,595 more Americans died in road accidents during the 12 months after 9/11 than would have otherwise.

Michael Rothschild, then an emeritus professor at the University of Wisconsin, calculated some of the risks we face:

One in 6 million: Risk of dying in a plane hijacking, assuming you fly four times a month and hijackers destroy one plane every year. (Just to be clear, since 9/11, hijackers have not destroyed any flights in the US.)

One in 7,000: the risk of dying in a car accident in any given year

One in 600: the risk of dying from cancer in any given year

According to data compiled from the Centers for Disease Control, over 2005-2014, an average of 11,737 Americans a year were shot dead by another American (21 of them by toddlers), 737 were killed by falling out of bed, and nine were killed by Islamic jihadists—who in most cases were US citizens, not immigrants (Nearly twice as many Americans kill themselves with guns as kill each other).

Rothschild blamed politicians for overstating the terrorist risk. Media saturation is also to blame. Having ready access to images of every atrocity known to mankind makes us prone to what behavioral scientists call ”availability bias,” the tendency to give weight to what comes to mind most easily. The blanket coverage of the Sept. 11th attacks successfully seared the images of terrorism on our brains; shootings, which happen every day and—with the exception of a few mass shootings—are largely ignored, have less of an effect.

“We over-react to visible threats,” said Max Bazerman, co-director of the Center for Public Leadership at the Harvard Kennedy School, and an expert on decision-making. “When there is someone out to get you, it is more visible than when you are silently dying in a hospital.”

After the Boston Marathon bombing in 2013, Roxane Cohen Silver and two co-authors looked at what caused more acute stress: being at or near the bombing itself, or being exposed to it in the media. They found “[r]epeated bombing-related media exposure was associated with higher acute stress than was direct exposure.”

President Trump may believe he is responding to people’s outsized fears of terrorism. Unfortunately, his hastily arranged executive order won’t work—not least because, as the Wall Street Journal found (paywall), “of 180 people charged with jihadist terrorism-related crimes or who died before being charged” only 11 came from the seven countries banned in Trump’s order. He didn’t ban people from Saudi Arabia, Lebanon, the United Arab Emirates, or Egypt—the home countries of the 19 perpetrators of the 9/11 attacks.

Correction: Due to an editing error, a previous version of this story said that 737 people died annually from being shot by someone else. It is 11,737.