1) In the original population of flies, mutations could occur that provide phenotypic similarity (alternation of dark and light bands) with bees.
2) This similarity saved from predators, increasing the chance of survival in the struggle for existence.
3) As a result of natural selection, this mutation entrenched and spread in populations, which led to a change in their gene pool.
Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.