For the many animal species that live in small, independent social networks (apes, wolves, whales, etc.), outsiders are typically dangerous, feared adversaries. Survival for such animals, therefore, requires not just the relative safety of one’s own group, but also a well-tuned ability to identify nonmembers.
Likewise, for millions of years beginning with humankind’s earliest communal framework — isolated, close-knit clans of hunter-gatherers — contact with strangers often meant capture, injury or worse. Accordingly, evolution over the ages gave humans our hard-wired tendency to fear and devalue “others.”
Relatively recently, around 70,000 years ago, abrupt and remarkable changes (by evolutionary standards) in the brain’s prefrontal cortex facilitated vastly more complex human thought — not least the concepts of empathy and compassion.