I remarked to someone basically the same thing - not only was it incredible that slums - corrugated-cardboard-house slums - sat right next to the 5 star hotel my company put me up in, but they were relatively safe.
One night we were walking through a slum because an Indian gentleman wanted to expound on my remark, and we came to a square that was decorated with lights and candles and flowers and all sorts of beautiful things. He said the people there had pooled their money, despite having so little. He then told me a lot had to do with the Hindu religion. Most Hindu's believed the position they were born into in life was the place in their spiritual journey they were meant to be, and doing well in that life was fundamental. It's a completely different way of looking at one's poverty.
He remarked that I wouldn't find the same type of sense of community in slums in Muslim parts of India, because their beliefs about their poverty and their lot in life was different.
I don't know if that's true, I didn't travel to any Muslim-dominated areas of India. It may have been true, it may have been his perception, but for that night, he was at least right about this local community, and it was a huge culture shock for a young man in his early 20s who had only seen slums in the US and, potentially more dangerous, Mexico City (and was warned to never, ever go there by my private corporate-sponsored driver).