You could see how your cats have a certain fascination for hunting small insects that move near him, one of these insects that have them hypnotized are flies. Oddly enough, it is a necessity nutritional, of an institute. Perhaps this is easier to understand in cats that do not have owners, but if it is perfectly fed we may not understand this strange behavior.
For the smallest cats those moving objects that pass through your eyes become a way of learning hunting techniques, techniques that you may need at some point in your life.
Despite being an annoying habit, it is very positive that he entertains himself by hunting flies. Since that is how they will develop their nervous system: brain and nerve connections.
It is clear that our cats, who are well cared for and fed, do not do it to satisfy a nutritional need but rather to have fun, to develop their instincts and (in some way) to stay in shape.
On the other hand flies are harmless, What we must do is pay attention that they do not play with wasps or bees that could hurt them with their stingers.