Managing social relationships also required humans to develop what anthropologists call a “theory of mind” — the ability to understand and identify with the thinking and motivations of other people. From an evolutionary perspective, the concept of self came after our ability to evaluate and remember the intentions and tactics of others. Unlike the relatively recent cultural changes that encouraged ideas of personal identity or achievement, our social adaptations occurred over hundreds of thousands of years of biological evolution. Enduring social bonds increase a group’s ability to work together, as well as its chances for procreation. Our eyes, brains, skin, and breathing are all optimized to enhance our connection to other people.
This is a nice way to describe how we evolved the capacity to have empathy.