Although it is possible for a pig to eat her young, this behavior is very rare. It most often occurs when the mother pig is under significant stress, which can disrupt normal maternal instincts.
If you observe this happening, reducing environmental stressors and consulting a veterinarian or animal behaviorist can help protect future litters.