Mina Cikara's research on intergroup competition (among others) documents that under competition conditions, the empathy gap between us and them can flip into something measurable as pleasure at the other side's failure. People surrounded by narratives of intergroup conflict are more likely to justify violence toward outsiders, and feel more schadenfreude at their misfortune.
We have powerful systems in our minds for empathy, but we also have systems that dampen empathy during threat.