How Fruit Flies Appear
When you find fruit flies in your home, the first thing to do is to find their source of food. The flies usually come from fruits, and can be attracted to fruit that has fermented or is decomposing. They lay their eggs on the surface of the decaying fruit. Depending on the species, they can lay as many as 500 eggs per day. You should remove fruit that has been infested with fruit flies as soon as possible. The larvae will feed on the surrounding fruit for a few days before they hatch into fully formed adults.
To prevent fruit flies from spreading throughout your home, it is important to store your produce properly. You should place a lid on your fruit jars and containers and make sure they are tightly sealed. If you store your produce in a plastic bag, make sure that the bag is tightly closed. You should also store your fruit in airtight containers to prevent them from becoming too overripe.
In the 1600s, Redi studied spontaneous generation in flies. He also discovered that fly larvae are microscopic and that they appear from thin air.