Flies can be attracted by almost anything that they consider to be a source of food, such as feces, garbage, fermenting fruit and dying houseplants. If a home has a sudden increase in flies, this means the flies have found an attractive food source somewhere nearby.
To get rid of flies, it is necessary for a homeowner to remove the food source. Sometimes this can be difficult, as it isn't always obvious what is drawing the flies in. Be sure to check for pieces of food that may have fallen behind the cabinets, or that may be stuck in the garbage disposal.
Additional steps that homeowners can take to prevent flies include taking the garbage out promptly, so that old food isn't left sitting around, as well as making sure to clean old food particles off of dishes that are left in the sink. For families with pets, any animal feces should be cleaned up as soon as possible. Also be sure to prune plants regularly to remove any dying leaves or other decaying parts which can attract flies.