Brain structure and learning capacities both vary with experience, but the mechanistic link between them is unclear. Here, we investigated whether experience-dependent variability in learning performance can be explained by neuroplasticity in foraging honey bees. The mushroom bodies (MBs) are a brain center necessary for ambiguous olfactory learning tasks such as reversal learning. Using radio frequency identification technology, we assessed the effects of natural variation in foraging activity, and the age when first foraging, on both performance in reversal learning and on synaptic connectivity in the MBs. We found that reversal learning performance improved at foraging onset and could decline with greater foraging experience. If bees started foraging before the normal age, as a result of a stress applied to the colony, the decline in learning performance with foraging experience was more severe. Analyses of brain structure in the same bees showed that the total number of synaptic boutons at the MB input decreased when bees started foraging, and then increased with greater foraging intensity. At foraging onset MB structure is therefore optimized for bees to update learned information, but optimization of MB connectivity deteriorates with foraging effort. In a computational model of the MBs sparser coding of information at the MB input improved reversal learning performance. We propose, therefore, a plausible mechanistic relationship between experience, neuroplasticity, and cognitive performance in a natural and ecological context.