It's not common that female eat their babies, but they do eat dead kittens. It's prefectly normal and they do it to protect the live babies from predators. Dead kittens (in the wild) attract scavengers and predators and that puts the live kittens at risk so the mother eats the dead kittens so they won't smell.
The only way to prevent it is of course to take away dead kittens from the mother. She won't mind.
In some cases, this is very unusual, the mother kills her kittens and she might eat them. This only happens when the mother is under severe stress and it happens among all predatory animals (dogs, cats, wolves, lynxes, lions etc.). It even happens with humans during times of war. I can't explain the machanism in detail, but somehow they do it in desperation... to keep their babies from getting hurt. It's paradoxical thing though.