Human pro-sociality within groups (tribes, clans, etc.) evolved from threat from outside or other groups of humans. For us as a species, our gift of pro-social, nurturing behaviors evolved in context of external threats from the other. Since the invention of stone tools, humans became the principal predator of other humans, and other humans became our principal source of safety.
Yes, indeed, through a process called epigenetics. Chances are you’ve never heard of changes in gene expression, since most people were taught your genes are for life. Well, we do have our genes for life—but many of our genes change their expression based on our social interactions at home, at school or in the community. Many of the genes that change the most involve our brains.