"You shall not murder" is a famous ten commandment phrase, and the same rule is enforced everywhere. It is one of the "universal rules" in human societies.
Yet, the no murder rule can be easily broken. In many cases, people kill others they don't even know. Why, I wonder.
My current idea is that people can kill people outside of their own community without much remorse. The mentality is easy to understand if you think of a village (only) 1000 years ago. The world was dangerous place, and the harm came from outside in the form of strangers or an army of enemy.
So, they may have developed a sense of community. Fear, probably, is the major drive for this action. Make a distinction between "Us" and "Them", and apply social rules to "Us" but not to "Them". In a war, brand them as an enemy, and you are free to kill them all.
The notion of humanist (we are all humans) may actually be a more recent invention.
You can see this distinction everywhere even now. No one is not guilty for making distinctions. It seems to be a human nature.
In fact, a person's identity is pretty much determined by these distinctions. Man, woman, Christian, Muslim, Red socks fan, American, Dancer, husband, Republican, Veteran, College grad,..... Name anything and all of the identity groups imply "Others" or "Them" who are not "Us".
Now, how much diffference in treatment will you put between "Us" and "Them"? Some people seem to be more comfortable to put bigger difference in treatment than other people.
Suppose there is a group of people who make clear distinctions, and who put a big difference in treatment between "Us" and "Them".They may have stronger affinity to a hateful attitude, exclusive religions or intolerance.
Here is a proposal for an exercise. Think of your own identity, and make a list of communities you think you belong. And check your own attitude toward each identity, and your attitude toward "Them".
This exercise can be fun. For example, a racist is a guy who chose to treat "Them" differently because of "their" skin color that are different from his. An American is a guy who has US citizenship (well, probably. don't ask me detailed legal questions for this). Now how does he decide to treat non-Americans?
Note that you can change the degree of distinction by your choice in many cases. Even if you cannot change the distinction itself, like your skin color, you can choose to change (or try to change) how you feel about it, or how you treat "Them".
But probably, from the eyes of almighty omnipotent all-loving Judeo-Christian-type God, the distinctions you make would seem trivial.