I'd say it's our monkey genes at work. When Chimps meet a male that is not their brother, they get theirs and kill him. Killing another community completely has been observed in the seventies.
I think that's definitely a part of it. Our monkey brains process that there is danger, and (naively) find ways to amliorate it in peer groups. We associate in-groups with safety and out-groups with dangers, and both infinitely large and infinitesimally small in (or out) groups would require the brain to do the much bigger work of individual threat analysis.
https://en.wikipedia.org/wiki/Gombe_Chimpanzee_War?wprov=sfl...