It takes some dramatic licence like all tv shows but for the most part it is very much grounded in the gritty reality of a city which currently ranks as the 15th worst city in the U.S for violent crime. Back in the mid-60s it was described by the International Association of Chiefs of Police as "the most corrupt and antiquated in the nation with an almost non-existent relationship with Baltimore's African American community." and that hasn't changed much in the past few decades based on a
recent case which saw 24 correctional officers convicted for being participants in wide-scale corruption in Baltimore's biggest jail. The corruption incorporated things like drug smuggling and prostitution, with the correctional officers actively taking part in both in collaboration with a gang which essentially ran the jail.
"13 of the accused were guards, who conspired with a violent prison gang to smuggle in contraband, ranging from cell phones to prescription pain pills. Female correctional officers took payoffs to have sex with gang members, including the gang leader, Tavon White, who fathered children with four guards. “This is my jail,” White declared in a January 2013 call, secretly recorded by the FBI. “I am dead serious. I make every final call . . . and nothing go past me, everything come to me.”"
The beauty of the Wire is it captures this kind of violence, corruption and "upside down" world in amazing detail and explores a lot of the underlying themes and causes of it. The creators were both deeply involved in this - David Simon was a crime reporter for the Baltimore Sun and Ed Burns was a Baltimore police detective for the Homicide and Narcotics divisions - and they managed to translate their experiences to the screen in all its gritty beauty.