Fruit flies sometimes occur when people bring them home on ripe or fermenting fruit from the grocery store. In other instances, the flies may smell fruits or vegetables and find their way into a dwelling through cracks or window screens. They then reproduce quickly.
Fruit flies lay eggs on the skin of fruit that is ripe or fermenting. They can transition from egg stage to adult stage in just eight days, and swarms can rise in less than a week. Once the flies are established indoors, getting rid of them does not necessarily eradicate the problem. They can find wet spots in plumbing or on old mops for breeding.