The actual origin of this term is a bit more grisly. It comes from the Vietnam War. When a U.S. officer demonstrated a bit too much idiocy and/or incompetence in front of his troops, and then ordered them to do something patently stupid one too many times, he was at risk of being 'fragged.' This was originally short for 'fragmentation grenade.' During action, one of his troops would make sure that a stray 'frag' fell in his vicinity, rendering the chain of command safe for the grunts. However, the term eventually came to mean any killing of an officer by his own men during confusion or action, when he might have been plausibly killed by the enemy.