Hi,
I've heard they do this because the babies are deficient in certain vitamins and minerals from the mother not being mature/healthy enough when she was pregnant. She knows they won't survive or if they do, be unhealthy or retarded, so she eats them to use the extra vitamins for her next pregnancy. Nature's way, I suppose. Also, the mice/rats will often eat their babies if you have touched them at all.
Anyway, that is what I have read, correct me if I am wrong.
~N