Fruit flies reproduce by laying eggs. Females lay as many as 2,000 eggs on wet, rotting surfaces. Within two days, those eggs become maggots, which eat the rotting matter they were laid on. Just a few days after that, those maggots have become flies.