Ever since the HMS Birkenhead wrecked in 1852, killing 450 people, the protocol of rescuing women and children first has been part of sealore. Almost as old, and equally entrenched, is the idea the captain is the last to leave a sinking ship. (Remember in "Titanic," when Captain Smith locks himself in the wheelhouse and goes down with the ship?)

So when Capt. Lee Joon-seok abandoned his sinking South Korean ferry with teenage passengers still on board, many of whom ultimately died, he faced immediate scrutiny. Lee is only the most recent captain faced with the choice between escape and heroism: Costa Crociere, Europe's largest cruise operator, now requires its captains to undergo psychological tests after one of its captains abandoned ship in a 2012 wreck that killed 32 people.

So what’s the psychological basis for making that choice?

World's Most Dangerous Oceans Identified

“It seems to me fairly obvious why a ship captain (or crew member) might abandon ship prematurely, leaving passengers to fend for themselves: overwhelming fear for his or her own life,” said Peter Sandman, a risk communication consultant.

The temptation, he said, is to chalk it up to panic. But that’s not quite accurate.

“Panic, properly defined, is limited to cases in which people act unwisely because of overwhelming fear,” he said. “People who are panicking lose their ability to think straight, so they do things they wouldn’t otherwise have done. When fearful people act in obviously self-defeating ways, that’s panic.  But when fearful people put their own survival ahead of the survival of others (even others they are responsible for), their behavior is selfish -- but it’s not irrational, and therefore not panic. The captain may or may not have felt panicky, but he abandoned his passengers, not his senses.”

Are some people simply hard-wired to be either heroes or cowards? Research in understanding behaviors in such situations is scant because mass emergencies are so rare, said Susan Krauss Whitbourne, a psychology professor at the University of Massachusetts Amherst. While some recent research suggests that we can be trained to become more selfless, most of it focuses on altruistic, not heroic, behavior.

Maritime police search for missing passengers in front of the South Korean ferry KIM HONG-JI/Corbis

“We don't really have enough situations that happen like this to say he was a psychopath, but when you see so many other people in emergency situations who become heroes, and you have the norms of situation which are virtually universal that the captain is always last to leave the ship … something really had to have snapped,” Krauss said. “It's like his brain skipped 25 beats and he wasn't thinking. I don't think he's an evil person; he now regrets it, and he’s in his own personal hell.”

And while social norms point to the captain to be the hero, unlikely heroes have also emerged from shipwrecks. In 1991, for example, while the captain and crew of the cruise ship Oceanos packed their bags and abandoned ship during a storm without notifying passengers, entertainer Moss Hills sounded the alarm and organized the evacuation, staying on board until all 571 people on board had been sent off in rescue boats or helicopters.

“What rank are you?” the emergency responders asked when Hills radioed in the SOS. “I’m not a rank, I’m a guitarist,” Hills responded. When asked what he was doing there, Hill replied, “Well, there’s nobody else here.”

PHOTOS: Five Maritime Disasters That Shocked the World

“The positive message, if there is one, is that ordinary people often do act as heroes,” Whitbourne said. “it’s human tendency.”

Lee, who has been charged with abandoning his boat, negligence, causing bodily injury, and violating "seamen's law," has said that he didn’t evacuate the ship immediately because passengers may have had an extended wait in cold waters.

“Once the emergency is over, a captain who has failed the ‘hero standard’ must feel a very strong need to self-justify -- grounded in shame, guilt, legal vulnerability, etc.,” Sandman said  “So he/she makes up reasons for having abandoned ship prematurely.”

A better approach, he said, would require another kind of courage: “to say instead: 'I always assumed that if I ever faced a deadly emergency I would stay at my post, as duty requires.  To my shock and shame, I didn’t. I fled. I put my own survival ahead of my passengers’ survival. You never know how you will measure up to an awful moment like this until the awful moment arrives. Now I know. I was required to be a hero, and I was a coward instead.”