In a headglitch, a player creates an angle or hides behind an object like a wall so that only his head is visible. While he can shoot normally, as if no obstacle exists at all, the opponent is left with only the hitbox of the head. This turns a headglitch into massive advantage for the player behind the obstacle and a big disadvantage for his opponent, since the attack surfaces differ greatly.
Exploiting/creating such scenarios is called "headglitching". While a headglitch is fundamentally not very realistic, it occurs again and again in popular shooters due to the mechanics of the game.