The dilution factor is something I hadn’t thought about.
Dump a few hundred foreigners in a town of 5000 and that’s very noticeable and some people will find it jarring. Dump ten thousand foreigners in a metro of three million and nobody will notice.
The point about conformism and exile cost is good too. Cities present endless options for social circles and employment. Little towns not so much.
To expand on this, consider the historic importance of culture for improving survival odds and thus conformism as a natural consequence. So it makes sense that people in smaller groups would exhibit associated tendencies, and also that people who exhibit those tendencies would tend to gravitate towards smaller groups.
Somewhat related recent discussion: https://news.ycombinator.com/item?id=46989124