Anything that manifests in reality has a science behind it. So it sounds like you’re asking about one of the softer sciences of sociology, anthropology, psychology, etc.
Animals do display communal senses of justice, fairness, kindness, punishment for bad behavior, etc. Just that they don’t speak our languages, so we just go off their behaviors. As I understand it, higher intelligent social creatures like elephants, primates, whales, dolphins, birds, dogs, etc. all display these qualities.
Where we are now as a species and what we’ve evolved to promote has come from multiple generations of social development that has been promoted through evolutionary breeding for people that have more of a natural tendency to social involvement. That’s how I understand it. The people that were more naturally genetically predisposed to social and group behavior breed more than the people that were not as much so. And over generations, that level of desire for societal collaboration became more and more pronounced. This is one reason why we go crazy when placed in long term isolation. We are no longer physically able to live in isolation.
It began with someone noticing that “fire - hot - bad” and then once in a social group, learning that empathy and promotion of the group’s well-being saved on the amount of energy it took to survive, leaving more time for breeding and ability to collect enough resources for healthy youths to group up safely.
It’s been my observation that religious people want moral absolutes for subjective issues. I liken it to Nutrition. Is it objectively true to eat an apple instead of a pear? Both are fine paths to nutrition, but it is objectively bad to drink acid. This is a good analogy for “human well-being”. There are many subjective pathways to promote human well-being, but we do know some objectively bad ways to hinder this. Like the stockpiling of resources to the detriment of another group, slavery, prison isolation, etc.