Is the mother hampster young or did you disturb the mother too much throughout the day?
Was the litter numerous?
Did you touch the hamster babies?
Are you giving your hampster enough food?
If a hamster is feeling excessively stressed, then it may eat its babies. It may feel as though caring for its young is more than it can handle and unfortunately kill and eat its babies. This may be more likely to occur in young hamster mothers or if you are disturbing the mother too much throughout the day.
If a mother feels as though it is overwhelmed with its new litter of pups, especially if it is a larger litter, it may decide it is unable to care for all the babies and eat some of them. The mother does this out of good for the rest of the babies to help them survive, even though it doesn't look like a kind thing to do.
The scent left on each baby helps the mother recognize the young. If a new scent, such as the scent of a human, is found on the babies, the mother might become confused and not recognize its babies. It may then kill and consume the perceived impostor because the scent of the baby changed.
Perhaps the most obvious reason why a hamster would eat its babies is due to the lack of food. Any animal that is pregnant or nursing is using more energy in its body than it typically would provide for its young. Therefore, more food is so necessary. The hamster may simply be hungry, or the lack of food may result in the fear of being unable to provide for its baby.
It is normal for mothers of many species to want to protect their young, and hamsters are no exception. But when hamsters are scared or fearful, this emotion can result in killing and eating their own young. Threats like a person that your hamster is scared of, other pets, loud noises, and other things that are intimidating to a small hamster can all cause it to eat its babies.
https://www.thesprucepets.com/why-do-hamsters-sometimes-eat-their-babies-4588707

Sreten null
Hi! I’m Sreten Filipović. I graduated from the Faculty of Agriculture at the University of Belgrade, with a master's degree in Environmental Protection in Agricultural Systems. I’ve worked as a researcher at Finland's Natural Resources Institute (LUKE) on a project aimed at adapting south-western Finland to drought episodes. I founded a consulting agency in the field of environment and agriculture to help farmers who want to implement the principles of sustainability on their farms. I’m also a founding member of the nonprofit organization Ecogenesis from Belgrade whose main goal is non-formal education on the environment and ecology. In my spare time, I like to write blog posts about sustainability, the environment, animal farming, horticulture, and plant protection. I’ve also published several science-fiction short stories.
You can find me on LinkedIn at https://www.linkedin.com/in/sreten-filipovi%C4%87-515aa5158/