I had a similar problem with flies. I found out more about it and it turned out that flies breed in the kitchen because there are fruits vegetables and organic waste. Fruits and vegetables are not so scary because they are in the refrigerator, but organic waste can be in a garbage bag. The solution to this problem is very simple installation of a waste shredder in the sink. Personally, I installed Badger 5 https://bestsinkdisposal.com/badger-5-vs-badger-500-garbage-disposal/ and am completely satisfied with the result.
Fruit flies or vinegar flies are small insects falling under the family of Drosophilidae or Tephritadae, both family of flies indicates dirty area of the house, infest fruits or meat in the kitchen and assist in easily decaying our food. The reason why fruit flies are commonly found in the kitchen is because this is where we put out unrefrigerated food (fruits, meat and other kinds of food).
They are called fruit flies typically because they normally fly around where fruits are may it be new or rotten. Once they fly around into the fruit or food, they can reproduce quickly, laying many eggs into rotting fruit or any decaying materials and these eggs can hatch in more or less than a day.