In the past few months, Donald Trump has gone from being a joke, to being the scary monster under the bed, to being the likely Republican candidate in the next election and possibly the next president. How did this happen? What has Trump tapped into?

Bernie Sanders has spoken about empathy. “When your child is hurting,” he said, “my child is hurting. We’re all in this together.” I believe that human beings have the capacity for this kind of empathy. But I also believe we have other, darker tendencies—part of the survival-of-the-fittest mind set developed when our species began to walk upright.

One of these traits is the tendency to fight fiercely for what we believe is ours when resources are scarce. Another is the way we identify one tribe as our own, while identifying others—on the basis of eye or nose shape, hair, skin color, or “talking funny”—as the enemy. Donald Trump’s rallies have appealed to both these instincts.

And there is a third consequence of our ancient struggles for survival. When we sense danger, our prefrontal cortex shuts down, activating a fight-or-flight response. We have a desire to join forces, to form a flock or herd, and to follow the leader—someone who keeps things simple and speaks confidently, someone who promises to take care of everything—a figure like Donald Trump (or like Hitler or Stalin or countless other demagogues in recent and ancient history).

An article in the Atlantic Monthly last summer asked whether successful business executives are more likely to be nice guys or jerks. In times of extreme stress, it concluded, employees prefer jerks who, they believe, will look out for them. We are living in a time of stress for the middle class, especially those whose jobs used to involve manual labor. They have been suffering for years, and they have been forgotten. We also live in a time of fear—especially of terrorists. If there is another terrorist strike on US territory or another stock market collapse, watch out. If panic sets in, our instincts will tell us, “Find someone who projects confidence, someone who promises protection. Follow the leader.”