In rural areas, you have no choice but to know your neighbors. You'll see them regularly, whether you like it or not, because there's only a handful of local stores. It's that repetition that builds trust and opportunity to slowly build a friendship up, and eventually become part of a community.
In the city, you get relative anonymity through sheer numbers. On one hand you get to blend into the crowd, but on the other hand you don't get to interact with the crowd. You have to luck, or maneuver, your way into a social circle of trust to get any kind of serious bonding. Even then, you may just be an isolated pod of people, still not feeling directly part of the community, you just walk through.
This is why I've always found the idea of not making friends with your workmates to be really backwards. They're pretty much your only social circle when you first get to a city. You're going to see them 5 days a week, what better group of people to bond with. You won't get that anywhere else in a city.
A new townhouse development goes up in a suburb/exurb and everyone that moves in is essentially 28-38, increasing social cohesion, but losing some diversity. My 100+ year-old neighborhood houses college students to people in their seventies.