Detrot was originally conceived as a retreat for the royal family, a trading hub, and an outpost against the monsters who still, now and again, sought to challenge Equestrian defenses. With the discovery of several rich veins of jewels nearby, the town grew over decades from those simple beginnings into an economic mecca to rival Canterlot itself in scope, if not necessarily in class.
Eventually, however, the jewel rush that had bloated Detrot into a vast urban sprawl dried up, leaving it to decay from within. As poverty, dashed hopes, and social pressures degraded orderly society, the city found itself better prepared to deal with the monsters of the wilderness than those in the hearts of its citizens.
"Read my ass. I'm A cop."
Hard 'Hardy' Boiled
"Death is shadowing you tonight, Hardy."
Taxi, summing things up as well as anyone.