Moisture and organic material attract gnats. Some species prefer the soil of houseplants, while others seek out decomposing food debris in garbage disposals or on damaged and over-ripe fruit. Any wetness in the home or unsanitary habits could draw them indoors and once inside, gnats are able to take advantage of conditions that are favorable for continuous development and reproduction.