There’s a phenomena called “epigenetic,” which holds that some behaviors in order to be expressed must have both the genetic foundation plus evoking environmental stimuli. Absent either, no expression.
A kid might be temperamentally quickly reactive to stimuli, and inclined as a result to be shy and fearful, but if raised in a protecting, quiet environment the kid expresses little if any of that behavior; if raised in a noisy and unprotected world, may be a basket-case. I suspect the same is true of compassion and empathy; absent the genetic foundation or the training, it does not happen.
Much as we here often criticize religion, that has been a major social influence in reinforcing at least conditional compassion and empathy –provided the person is the “right” class, religion, gender, politics or ethnicity. I do not, as a result, castigate all religious text, some of it and its practice has been admirable. Not because it implies a deity, but because there’s some great precepts in it, as there are in other works by human beings. The deity bit is just organizational self-serving rhetoric by churches to try and make the messages more accepted or less rejected.
Socioeconomic status (SES) is a good predictor of compassion and empathy. No person by virtue of membership at some point in SES is thereby imbued with virtue, or lack of it, but given that such behavior is only a probability, the chances are skewed toward SES 1,2,3, and 4, with 5 producing by far the highest rate and incidence of no-empathetic and non-compassionate behavior. That’s why by far most of the people incarcerated for vicious, violent crimes come from class 5, which is only maybe 18% of the population. Being poor and ignorant is only “noble” if that claim is made by some Cleric trying to justify and maintain the “social order,” in which he is not at the bottom.
The first two sentences of this post contain my main point.