A simple explanation for this behavior is as follows: when a barrel explodes, the Doom engine tracks which player or monster caused the barrel explosion. When damaging another object as a result of the barrel explosion, the "source" of the explosion is then passed on to the damaged object. A monster hurt in a barrel explosion will then retaliate against the monster or player that caused the barrel to explode (an example of monster infighting, if the source is another monster).
However, if a monster damages itself in a barrel explosion, it is the cause of its own injury. Doom v1.1 does not check for this special case (it is not a scenario that occurs frequently during normal play). As a result, monsters that injure themselves through a barrel explosion will retaliate against themselves. Monsters such as cacodemons, barons of hell and imps will "tear themselves apart" with their own melee attack. Former humans (or monsters without melee attacks) will "go crazy", firing ahead blindly, possibly causing monster infighting as a result.