Fruit flies work much the same way as other flies. However, they are particularly drawn to fruit. Soft rotting fruit is a fruit fly’s favorite place to lay their eggs and hatch their young. Fruit flies will lay their already fertilized eggs on especially mushy rotting fruit and those eggs hatch into maggots. Maggots only take 24 to 30 hours to hatch after the eggs are laid.
After that the maggot lives for one week on the rotting fruit before burrowing deep into it and when it emerges it is an adult fruit fly. Just two days after fruit flies reach adulthood they start being sexually active and begin the process all over again. They basically work their entire lives just to reproduce and make more fruit flies.