Orson Scott Card’s Shadow series covers this in part, as for how Peter managed to unify the world under his Hegemony. In short, people identify with their own tribe (whatever that may be), and are distrustful of other tribes. Vis a vis, New Yorkers and anyone who lives in New Jersey. However, you have to lower the boundaries between the tribes (somehow) and get everyone working together to totally eliminate tribalism. Doing that is hard. As the song points out, it’s been solved in a couple of big areas, but there’s still stereotypes and bais at work.