You just had a run in with chicken cannibalism.There are six common forms of it Toe picking, Tail pulling, Feather picking,Vent Picking, Head picking, and egg eating. Pullets often lay their eggs in foreign spots for who knows why mine laid off of her roost each night. These are the possibilities of cannibalism:
-Overcrowding
-Boredom
-Lack of exercise
-Bright lights
-excessive heat without ventilation
-too little perching space
-too little feeders or waterers
-feeding or drinkers being placed too close together
-nutritional imbalance
-external parasites
-insufficient opportunities to engage in normal behavior
Pulled from "The Chicken Encyclopedia" by Gail Damerow
Sometimes if they lay eggs than they become cracked they'll taste the yolk and eat it. Sometimes this is hard to control when you have a hen that eats almost anything.