I recall reading years ago about how animal behaviorists showed that rats forced to live in an environment with too many other rats tend to get hostile and aggressive. The implication was that the phenomenon applies to people, too.
Fast forward to 2013 when writers were explaining how it was that Obama beat Romney in the big metropolitan areas, and Romney won in the wide open spaces of flyover country.
One theory was expressed in How the Density of Your County Affects How You Vote. This article argued that the more dense the population was the more likely the people were to vote for Democrats. Excerpt:
People who live close to one another are more likely to know someone of a different color, a different income group, or a different sexual orientation. They therefore rely upon and appreciate the provision of public goods and public services (transit, parks, garbage collection), even as they consume fewer public dollars than their less-densely populated counterparts.
That suggests the race turned on prejudices and public services. But looking back at the rats, the tight pack may have made them meaner. And it was easier to strike out at someone who is different, someone belonging to another tribe, someone who they wouldn't likely have to share an elevator with. That would be Republicans.
Fast forward again to 2016 and the same thing happened -- the big cities voted for Clinton for the most part. Now listen to Democrats, and you sure can hear that mean streak.