Intersubjectivity, or theory of mind, is a cognitive skill of intuiting mental states and intentions of others. This empathetic ability allows for advanced cooperation. Our capacity for impulse control and language due to highly developed brains enables successful group coordination.
The foraging genus Homo evolved two to one million years ago and lived at low densities, with no signs of wars. Anatomically modern humans, Homo sapiens, emerged only about one fifth of a million years ago. Behaviorally modern humans exist for less than tenth of a million years. About twelve thousand year ago people created complex societies and started engaging in warfare, which is evident from archaeological data. Social bonds became essential.
Our empathy might come from the group care for children in genus Homo, when parents and alloparents provisioned young. Cooperative breeding as a reproductive strategy evolved before significant enlargement in brain size. This strategy is used by other species as well, more by birds than by mammals. It offers advantages for parents and children, and is good for the success of the species because it supports reproductive success in various habitats. Empathetic sensitivity to children's needs would be favored by natural selection. Maturing kids with such traits then stay with the family of origin longer and respond to younger siblings. Sometimes, such behavior by alloparents is self-serving, it can offer additional resources and experience. In other cases it is forced by dominance, and subordinate individuals nurse babies of alphas instead of their own.
In about half of modern primate species, mother cares about her child alone, most often because she does not want to share, and in about fifth some group care is practiced, which promotes social learning. In most social mammals females remain with the group where they are born, and the amount of support by fathers varies.
By one hypothesis, women who lived many decades after menopause, grandmothers, were favored by selection because they increase, almost double, the survival rate of the young.