Yeah, basically if you ever witnessed a hamster eating its babies it was probably your own fault or the fault of whoever was raising them, one way or another. You should probably stop doing full cleanings of the cage/be really careful about any cleaning for a bit when the babies are still under a certain age, for instance. You'd just stress the mother out, maybe your scent will get in there and cause various primal instinct type concerns. Don't touch any of the babies until they're a certain age either unless absolutely necessary for the same reason. Again, you'll stress the mother out. The fathers are also known to sometimes eat the babies for little to no reason, but you were supposed to get him out of there by then. You really shouldn't leave the breeding pairs together 24/7. Even same sex pairs of the more social breeds don't always get along, leaving a male that'll wanna go to pound town in a relatively confined area with a female that isn't always up for that is a good way to witness a pretty nasty fight that could even leave your male hamster unable to breed anymore.
Not that anyone asked for that much to be said about hamsters.