Fruit flies come from a variety of places, including:
Overripe or rotting fruit or vegetables. Fruit flies are attracted to the sweet, fermenting smell of overripe fruit. They can also breed in rotting vegetables.
Sink Drains. Fruit flies can breed in drains that are not kept clean. The moisture and food particles in drains can provide a perfect breeding ground for fruit flies.
Trash cans. Fruit flies can also breed in trash cans that are not kept clean. The food particles in trash cans can provide food for fruit flies.
Open windows and doors. Fruit flies can also fly into homes through open windows and doors.
Fruit or vegetables are brought into the home from the grocery store. Fruit flies can sometimes be attached to and brought into the home on fruit or vegetables purchased from the grocery store.
It can seem like fruit flies come from nowhere, but they usually have a source. By identifying the source of the fruit flies, you can take steps to get rid of them.