In 2002, HBO’s drama “The Wire” changed what everyone expected of crime dramas. Before “The Wire,” police on television always solved crimes in an hour. In this series, we saw that the battle against drug trafficking is never finished in one hour, or ever, really. That’s much like how the battle against Iraqi or Afghan insurgents isn’t over just because the military says it is.

You can believe your organization is unique, but it isn’t. The battles the military faces today are similar to many of the same challenges that faced the Major Crimes Unit of the Baltimore Police Department in “The Wire,” from the sometimes weak leadership you work under down to the enemy on the streets, whether those streets are in Baltimore or Kandahar.

“The Wire” is a gritty account of that unit trying to gain the upper hand over the ever-regenerating tentacles of drug traffickers in Baltimore. After vainly attempting to disrupt the drug network by low-level “buy and busts,” Major Crimes briefly gains the upper hand by figuring out how to tap into the criminals’ communications network: the eponymous “wire.”

The triumphs and travails of the characters in The Wire provide insight both on organizations and on war. (Warning: spoilers ahead.)

The good guys of the series have a lot to teach us.

The Major Crimes Unit’s commander for most of the series, Lt. Cedric Daniels, is a leader who wants to accomplish the mission, but who won’t compromise or cut corners to do so. He stands up to his superiors when necessary, but doesn’t antagonize them unnecessarily. He is tough on his people, and though they don’t always like him, they respect him. Eventually, he loses the police commissioner job he’s worked his whole career for when he refuses to falsify crime statistics for City Hall. If you can emulate Daniels, maintaining your integrity while accomplishing the mission, then you’ve done all you can.

Maj. “Bunny” Colvin is the innovator of the Baltimore Police Department; you might even call him the counterinsurgency expert of the show. As the commander in the notorious Western District, he’s the only district commander in the city able to reduce violent crimes. He does it by taking a lesson from the city’s long-ago problems with public alcohol consumption and applying it to the drug war. He acknowledges that drugs cannot be completely eradicated, only controlled. He pushes all of the drug traffic in his district to a small area, dubbed “Hamsterdam.”  By doing that, he find huge success in lowering the crime rate — at least until his superiors find out how he did it. His solution to the problem shows us that we must have a clear and attainable mission; in this case, should the actual mission be to reduce violent crime or to eliminate the drug trade? The same type of decision should be part of military operations. For example, is a war’s goal the achievable one of building up a stable government, or the perhaps impossible one of leaving behind a Western-style democracy? Once a decision is made, leadership all the way up and down the chain has to agree on it or any goal is doomed to failure. That unity of effort would have served the city of Baltimore well.

Detective Jimmy McNulty is dedicated to his work. Exceptionally so. He’s so driven that he has successfully pissed off his entire chain of command, as well as lost his wife. He’s also likely an alcoholic. He’s extremely talented, but his dedication to his mission comes at the expense of ethics. Eventually he begins manufacturing crime reports in order to get resources for his cases. He’s a case study in ethical drift: once he lost sight of core principles, even though he was accomplishing the mission, he was not on the same team anymore. His failed hero’s journey is a cautionary one for anyone working in a job involving life and death.

Maj. William Rawls, who begins the series as head of the homicide unit, is technically one of the good guys, but that’s really in name only. He’s not wholly corrupt, just an example of ambition displacing mission accomplishment. He games the system in order to further his career. He resists Major Crimes’ attempts to go after the sources of drug distribution and the recipients of laundered drug money, because it doesn’t make for “good stats” and because that information will be damaging to his patrons. He crushes Bunny Colvin’s Hamsterdam initiative, in spite of the fact that it was saving lives. Rawls is an effective leader in the eyes of his superiors, but his personal success is at the expense of his people and the mission. He is the perfect example of the downside of excessive careerism in an organization. Organizations have to make sure they reward results, not necessarily statistics.

The bad guys have some lessons to teach as well.

Avon Barksdale is the leader of Baltimore’s most powerful drug gang. His crew runs a profitable heroin trade. Over time, Barksdale and his second-in-command, Stringer Bell, find themselves at odds over how to run the organization. They cannot agree whether their goal is to win the streets or to earn money. This conflict lays the groundwork for the ultimate collapse of their drug ring. From an organizational standpoint, it shows how disagreement over the direction of an organization can lead to failure.

Omar Little is a criminal who “rips and runs,” robbing drug dealers. For much of the series, he makes more of an impact on the drug trade than the police. For a time, when his goals are in concert with the police, they actually use each other to damage the Barksdale crew. Likewise, sometimes in war, you may have to consort with less-than-desireable individuals or groups in order to accomplish goals on the battlefield. The U.S. military discovered this during the Sunni Awakening during the Iraq War.

When the Barksdale crew falls, it results in the rise of an even more vicious drug lord, Marlo Stanfield. Marlo rules the street with a reign of terror, dropping dozens of bodies. This is similar to how al Qaeda was largely supplanted by the even more violent ISIS. Among these types of groups a terrifying form of survival of the fittest exists. In any struggle, unless those fighting evil have a plan for an endgame, the game is never going to end.

In the end, after five seasons of television, The Wire’s Baltimore is no better off than when the Major Crimes Unit started. Only the faces on both sides have changed. The police continue to fight the good fight, and the criminals continue to victimize citizens. Even so, both unwittingly demonstrate the most important lesson of the show, uttered by Detective Bunk Moreland. “A man must have a code.”