Yeah, that's true, especially with young fish. I think a lot of this "eating" behaviour has to do with the constant pressure put on the pair to guard the eggs/fry from other fish in a community tank setting. Leaving fry too long with the parents can trigger this behaviour as well, as the pair begins to spawn again. Although some fish may always eat their young, in my experience, this behavior declines sharply when the breeding pair are separated from the group. This is what leads me to believe that "eating" can be the result of a perceived, constant threat from the other fish in the confinements of a tank setting.