I'm not positive as to why they do it, but sometimes our rats do it when they don't get enough protein. They might eat each other if they aren't feed enough. We had that happen when we went on vacation and our neighbor was neglecting to feed our rats properly.

Sorry to hear about the babies