How to best understand how animals think about the world? Considering that cognition develops in interactions with the outside world, we need to compare the cognitive performance of individuals of the same species living under different ecological conditions. I propose here to compare the notion of weight studied in captive chimpanzees to the ones observed in a wild chimpanzee population that is using hammers of different weights to crack nuts during many months of the year. Detailing different situations where the chimpanzees have to select a hammer for cracking two species of nuts of different hardness, my colleagues and I could illustrate the flexibility of the causal reasoning performed by the chimpanzees, including stable anticipation of weight, combining weight with density and transport distance, and the gradual shift of selection criteria with increasing transport distance. Combined with results from captive studies on the notion of weight in chimpanzees, this suggests that when individuals face specific ecological challenges, they may acquire sophisticated causal reasoning generalized over different contexts. The evolution of cognition in chimpanzees suggests a complex interplay with ecology, memory demands, individual differences, and technical challenges important to the population.