The reason behind their attraction
The saying “flies on poop” is quite well-known, however, it normally uses a coarser word than “poop.” We probably haven’t ever questioned the deeply rooted belief that flies are drawn to excrement, as it is part of our common sense. After all, flies like to congregate around the dirtiest things—from dead animals and rotten food to overflowing trash cans. But, as the Western Exterminator points out, flies are also interesting animals. They are not like humans in the way they move, breed, or eat.
For example, because they can’t chew solid food, houseflies usually only consume liquids. According to this article, they regurgitate digestive juices onto solid foods and these juices break down the food into small pieces, allowing them to use their mouth-parts, called proboscis, to drink the meal. Because their chemonsensilla, or receptors, are found on their feet, flies can literally taste with them. In other words, flies basically land on something to eat it.
Flies find poop delicious and helpful
When flies land on anything tasty, like your food or anything else, “They will often wander around to give their next meal a good taste before consuming it.” To provide their larvae, or maggots, with food when they hatch, flies also frequently deposit their eggs on a variety of surfaces, including rotting fruit and carcasses. Naturally, this indicates that flies are not very hygienic. They only need to land on food or dishes to spread all kinds of bacteria, such as salmonella and E. coli.
To put it simply, flies are attracted to the smell of excrement, according to Matan Shelomi, a PH.D. in entomology, who answered a question on Quora. Meanwhile, a reader points out that because feces are so nutritious, flies are typically drawn to them. It’s suggested that “Feces contain large amounts of dead and alive bacteria, fats, proteins, indigestible carbohydrates (like cellulose — fiber), minerals, and trace amounts of other nutritious goodies.” Despite having no nutritional benefit for humans, flies have special needs. For them, excrement serves as both a secure nesting site and a nourishing food.