One of my female rats has eaten her whole litter twice in a row... What would make her do that?

I have a 1.2 trio of rats set up in a 20 long tank, and I do not take the females out when they give birth. The other female raises her pups fine, but this other one always eats them when they are still in pinky stage.

Next time I see that she is prego, I am planning on putting her in her own tank to give birth, I hope that helps, or that I can get some advice that will. If not... well... I have a Borneo STP that would like to meet her.