Individual animals differ in the way they cope with challenges in their environment, comparable with variation in human personalities. The proximate basis of variation in personality traits has received considerable attention, and one general finding is that personality traits have a substantial genetic basis. This poses the question of how variation in personality is maintained in natural populations. We show that selection on a personality trait with high heritability fluctuates across years within a natural bird population. Annual adult survival was related to this personality trait (behaviour in novel environments) but the effects were always opposite for males and females, and reversed between years. The number of offspring surviving to breeding was also related to their parents' personalities, and again selection changed between years. The observed annual changes in selection pressures coincided with changes in environmental conditions (masting of beeches) that affect the competitive regimes of the birds. We expect that the observed fluctuations in environmental factors lead to fluctuations in competition for space and food, and these, in association with variations in population density, lead to a variation in selection pressure, which maintains genetic variation in personalities.