In 1982, the movie “Star Trek II: The Wrath of Khan” hit theaters and sparked new life into its ailing franchise. The 1960s television series was a moderate success, but excitement about Captain Kirk and his crew on the big screen waned a bit following the drawn-out existentialism of “Star Trek: The Motion Picture.”

In many ways, today’s “Star Trek” fans have the unusually busty Khan and his pursuit of a planet-killing weapon to thank for establishing much of the tone and direction that would define the entertainment brand both in the theaters and for its return to television. But for those of us who grew up watching “Star Trek” before going on to serve in the military, “Wrath of Khan” brought us something else of great importance: the Kobayashi Maru test.

The basic premise behind the test is simple. Starfleet officers are placed in command of a simulator and presented with a difficult decision: to rescue a civilian freighter called the Kobayashi Maru trapped in a “gravitic mine” along the border of the Klingon Neutral Zone. In modern military terms, that would be akin to South Korean troops at the height of North Korean tensions spotting a civilian vehicle stuck on a mine in the demilitarized zone dividing the two nations.

The right thing to do is to help those innocent people, but the simulation is designed to ensure that making the right call invariably leads to the destruction of the Federation ship and the deaths of all crew members on board.

The Kobayashi Maru: Star Trek's vital lesson for military leaders
(Photo: Paramount Pictures)

The no-win situation every leader fears

Almost immediately after entering into the Neutral Zone, things begin to go wrong for the officer-in-training. First, other officers on the bridge warn the trainee that they’re about to violate the peace treaty with the Klingons. Then, communication with the civilian ship is lost completely—just as Klingon vessels appear in pursuit. Any attempt at communications with the Klingons is met with silence. Finally, the overwhelming force engages and inevitably destroys the Federation ship and the trainee’s entire crew.

It doesn’t matter how good a commander you are, how technically proficient you are in a fight, or what types of maneuvers you attempt to escape. In the Kobayashi Maru test, officers are exposed to dramatic, unavoidable failure with no one to blame but themselves.

What good does that do?

As (an admittedly unusual) young man, I used to venture off on Saturday mornings to play peewee football with my peers, then spend the rest of the afternoon recuperating in my bedroom and watching old movies my dad recorded off the television (the original DVR). My favorites were always the various incarnations of  “Star Trek.” It was during those years—when ideals such as my drive to work hard and to serve as a leader in situations like my football team were in their infancy—that “Star Trek” exposed me to the Kobayashi Maru and its important lessons, reiterated in different forms throughout the franchise.

The Kobayashi Maru: Star Trek's vital lesson for military leaders

The concept that you can try to do the right thing and still lose isn’t prominent in the entertainment most kids are exposed to today. Overwhelmingly, any attempt to impart a lesson about “doing the right thing” will almost always make it seem like if you choose the “hard right” over the “easy wrong,” fate will reward you for your tenacity.

The truth is, fate doesn’t play favorites based on intentions or ideas about “right” and “wrong.” Sometimes, failure is inevitable. Sometimes, failure is your fault. Good leaders need to know how to cope with that reality, and essentially learn how to maintain control over themselves and the situation when failure becomes apparent.

As a Marine, I failed countless times. Often, they were personal failures; sometimes, they were public ones; and a few times, the stakes were greater than I was aware of at the time. Mere weeks after I was put in charge of my own shop, one of my Marines committed suicide. I spoke to him the same day it happened, even prodded him a bit about how he was doing because he had been going through a difficult time.

Like the Starfleet cadet in the Captain’s seat of an ill-fated simulation, I remember leaning back in my chair and making the call to take him at his word that things were okay. Like that cadet, I made a decision that would prove to be the wrong one.

The weight of failure can be overwhelming

A failure that costs a person’s life isn’t something you get over. It’s not a bad memory you try to shake off when it crops up, it’s not a flashback you get on cold nights, and it’s not a secret you bury deep inside you. It’s who you are now.

No matter where I go, no matter what I do, I carry that failure—and others—with me. That Marine (whose name I won’t share for the sake of his family) wasn’t a simulation. When my egregious failure of command was over, the lights didn’t come back on and there was no Captain Kirk there to pat me on the back and ask me what I did wrong. A mother lost her son, and I was left to wonder forever what could have been different if I’d just made another call.

Not just for nerds: How watching Star Trek as a kid made me a better Marine as an adult

Read Next: Not just for nerds: How watching Star Trek as a kid made me a better Marine as an adult

Serving in the military may not be the life and death struggle that it’s often depicted as in the movies, but the very real and looming threat of failure is ever-present. The stakes are never higher than they are with a flag on your shoulder and lives in your charge. If you stick around in one of Uncle Sam’s gun clubs for long enough, you’ll find your own Kobayashi Maru—a situation with no good outcomes; or a failure you caused by doing what you thought was right.

The weight of that failure can be overwhelming, but for individuals in command during war time operations, the ability to overcome that, to bear the weight of your decisions and move forward smartly, can mean the difference between burying one good man and a dozen. Failure is the painful cost of leadership. Good leaders learn to bear the weight. Great leaders grow stronger beneath it.

The Kobayashi Maru: Star Trek's vital lesson for military leaders
An unwillingness to give in is important, but as Captain Kirk will come to find, it’s also important to develop coping mechanisms for failure.

Business schools teach the Kobayashi Maru test as an example of why it’s sometimes important to circumvent the rules—something Kirk did during his pass through the exam. But for military leaders, it has a different vital significance. Leaders need to know the feeling of failure. They need to see their decisions snowball. They need to watch their command decisions blow up in their faces—and they need to know how to recover.

The Kobayashi Maru may be a fictional test designed as a plot device in science fiction entertainment and dusted off periodically throughout the franchise to make a point. But to this Marine, it serves as critical reminder that life doesn’t follow a neatly-written narrative.

Sometimes you just lose, and that’s that.

If you’re going to lead, that possibility is always going to be the price of admission. Regardless of where you learn it, that’s one hell of an important lesson.