Because humans are tribal they will also go on to attack and prey on those who are outside their tribe, making diversity more dangerous. Especially when diversity is not merely some people of different ethnic/racial backgrounds living and working together, but a population split into isolated cultures with different circumstances.
Unless there's a big strict enforcer to keep everyone in line of course.
This is something a lot of people seem to believe that is not borne out in the research. Plenty of specific counter examples like Queens NY, a densely populated and exceptionally diverse place with crime rates comparable or better than many much more homogenous places in America. Poverty and income inequality are much better predictors. I felt this reddit comment from a while ago did a pretty good job rolling up sources on this: https://www.reddit.com/r/TrueUnpopularOpinion/comments/1jxff...