Estimates of selection in natural populations are frequent but our understanding of ecological causes of selection, and causes of variation in the direction, strength and form of selection is limited. Here, we apply a multilevel framework to partition effects of great tit fledging mass on first-year survival to hierarchical levels and quantify their ecological dependence using a data set spanning 51 years. We show that estimates of the effect of fledging mass on first-year survival decline threefold from year- to brood- to individual level, so that estimates of selection depend strongly on the level at which they are calculated. We identify variables related to summer and winter food availability as underlying higher-level effects of fledging mass on first-year survival and show experimentally that brood-level effects originate early in development. Further, we show that predation and conspecific density modulate individual-level effects of fledging mass on first-year survival. These analyses demonstrate how correlations between traits, fitness and environment influence estimates of selection and show how partitioning trait effects between levels of selection and environmental factors is a promising approach to identify potential agents of selection.