Before about 360 million years ago, no vertebrates had limbs. They all shared the same fish-like body shape. But around that time something exciting happened.
So sometimes parents or stronger offspring will eat the weaker offspring in order to increase their own chances at survival.
Do fish actually have a working memory? Recent experiments show that fish can in fact remember things for several days.