It’s evolutionary to see danger in strangers because historically it was better to overestimate danger then underestimate it for your survival. You can only react once if someone hits you with a stone from their back. So people and groups overestimate danger that they will be hurt/diminished in some way and then attack when they see the slightest sign of a threat. It can be used to manipulate crowds, just say their children are in danger because of the out-group. Can really recommend the book on the exact mechanics of anger by the most influential psychologist of our times https://www.amazon.com/Prisoners-Hate-Cognitive-Hostility-Vi...
I can recommend this book. The most influential psychologist of our times explains the mechanics of anger. The basic idea is that we interpret the benign things like mistakes or tiredness of others as intentional and become angry at them. Our evolution predisposes us to interpret neutral events as intentionally directed against us. We can change that https://www.amazon.com/Prisoners-Hate-Cognitive-Hostility-Vi...