The ability to learn and form memories is widespread among insects, but there exists considerable natural variation between species and populations in these traits. Variation manifests itself in the way information is stored in different memory forms. This review focuses on ecological factors such as environmental information, spatial aspects of foraging behavior and resource distribution that drive the evolution of this natural variation and discusses the role of different genes and neural networks. We conclude that at the level of individual, population or species, insect learning and memory cannot be described as good or bad. Rather, we argue that insects evolve tailor-made learning and memory types; they gate learned information into memories with high or low persistence. This way, they are prepared to learn and form memory to optimally deal with the specific ecologies of their foraging environments.