Over the past decades, research on insect cognition has made considerable advances in describing the ability of model species (in particular bees and fruit flies) to achieve cognitive tasks once thought to be unique to vertebrates, and investigating how these may be implemented in a miniature brain. While this lab-based research is critical to understand some fundamental mechanisms of insect brains and cognition, taking a more integrative and comparative view will help us making sense of this rich behavioural repertoire and its evolution. Here we argue that there is a need to reconsider insect cognition into an ecological context, in order to design experiments that address the cognitive challenges insects face in nature, identify competing hypotheses about the cognitive abilities driving the observed behavioural responses, and test them across different populations and species. Reconnecting with the tradition of naturalistic observations, by testing animals in the field or in ecologically-inspired setup and comparing the performances of individuals, is complementary to mechanistic research in the lab, and will greatly improve our understanding of the role of insect cognition, its the diversity, and the influence of ecological factors in its evolution.