This kind of blind loyalty is not exclusive to the military—think of relatives who profess that their loved one is incapable of violence even after he or she has committed a crime. But the loyalty that a suspect’s defenders show takes on outsize importance in the military context. Backed by the tradition of the “good soldier” defense, positive testimony about a soldier’s military character can significantly affect a case’s outcome. What’s more, a soldier’s commander can decide whether a case should be brought in the first place.

The good-soldier defense is baked into the military justice system, and it’s based on a breathtakingly shallow line of reasoning: that just because someone is good at the job, he is incapable of committing a crime. Used to suggest that an accused has “good military character,” the argument alone can be the basis for reasonable doubt or dropped charges. And when testimony supporting an accused soldier’s character comes from a general or a flag officer, it can overwhelm all other evidence of guilt.

The good-soldier defense isn’t just deployed during court proceedings—it affects pretrial decision making too. In contrast with the civilian justice system, senior commanders alone determine whether a service member in their own chain of command will or won’t face court-martial. If Porter had been one of Kelly’s Marines, and under investigation for spousal abuse, Kelly would have decided whether Porter would be prosecuted.

Even if an offender is no longer under a commander’s watch, the senior officer still has the ability to put his thumb on the scales of justice. In my experience, generals often go to bat for their favorite service members in an attempt to convince another commander to drop charges. From behind-the-scenes phone calls to glowing letters and emails, senior officers can be persuasive.

And if they’re unable to derail a case from going to trial, they often still try to influence the proceedings. Time and again, I witnessed generals and admirals affect case verdicts and sentences thanks to their favorable testimonies at court-martial. I’ve seen their defense supersede photographic evidence and other testimony—including accounts from additional alleged victims. This is essentially what Kelly offered Rob Porter: the power of his word over the word of Porter’s ex-wives.

Kelly has exerted similar influence before. In 2016, he was among four Marine generals who testified during a sentencing hearing for Colonel Todd Shane Tomko. Despite allegations of sexual harassment against a subordinate—as well as convictions for violating a military protective order, illegal steroid use, and driving under the influence, among others—Tomko was, according to Kelly’s testimony, a “great Marine” and respected leader. Tomko is now awaiting a civilian trial for the alleged sexual abuse of multiple children dating back more than 15 years.