Morale

Creatures have the three following values related to their morale. Spells and Items that grant immunity to Morale Failure do so by setting a creatures Morale Break to 0, such that it cannot be less.
 * Morale: Current morale, engine caps the value to the range 0 to 20
 * Morale Break: If current morale is less than this value, Morale Failure occurs, the affected creature will wonder aimlessly, unable to control or interact with
 * Morale Recovery: Ticks (1/15th second) between recovering 1 point of Morale. Most creatures have this value set to 60, or 4 seconds

Protagonist’s Morale Break and Recovery are both 1, making it almost impossible for them to suffer from Morale Failure. They can, but immediately recover from it. Some of the new EE companions have their Morale Break set to 0 by default, making it normally impossible for them to suffer from Morale Failure.

The specific events which cause current morale to decrease or by how much amount are still unclear, though death of an ally is certainly one of them, and damage taken/low health also contribute.

Panic (Opcode 24) and Remove Fear (Opcode 161) are completely separate from Morale Failure. They cause similar results, but the mechanics do not influence each other, and will not work to cure the other.

Sources & references

 * Credit to kjeron, for the info and most of the writing