Summary Several hypotheses have attempted to explain why sedentary populations persist in the wintering grounds of many migratory bird species. For instance, residents may overcome the flooding of their range if they are better competitors than migrants. Alternatively, each population fraction may use different resources or even different habitat types, for example because residents benefit from site tenacity while migrants benefit from resource tracking. To evaluate these hypotheses, we studied the distribution of sympatric migratory and sedentary blackcaps (Sylvia atricapilla) in southern Spain during two winters. We distinguished two habitat types: forests, which are used by residents for breeding, and shrublands, to which blackcaps spread in winter with the arrival of migrants. Shrublands are unsheltered habitats that show more abundant but less diverse fruits than forests. We investigated (i) if blackcaps show habitat segregation with respect to migratory behaviour, sex, age and body size, (ii) what resources are used by each population fraction within each habitat type and (iii) how habitat occupancy affects the body condition of individuals. Residents were almost completely restricted to forests, while migrants occupied both habitat types. Among migrants, adults predominated in forests and juveniles in shrublands, but no sexual segregation was found. Body size was larger in residents than in migrants, and these were larger in forests than in shrublands (especially juveniles). If larger birds are dominant, these results support the idea that residents may endure in forests and exclude the most subordinate migrants (juveniles and small birds) towards shrublands. Within forests, migrants and residents tracked fruit abundance, but residents were also associated with the most suitable breeding sites. Migrants tracked fruits less closely in shrublands, due probably to a higher fruit abundance and a lower availability of shelter. Habitat segregation did not affect muscular development of migrants. However, migrants accumulated more fat in shrublands. Therefore, differences in nutritional quality cannot explain why adult and larger blackcaps predominate in forests. Instead, other factors such as food diversity or exposure to predators might account for this distribution. Our results provide a mechanism to explain the persistence of sedentary populations despite migrants overflowing their range and using the same resources. Residents may challenge the arrival of conspecifics because they are better competitors. From an evolutionary perspective, this shows that non‐breeding processes may be as important as breeding benefits accrued to migrants for explaining the dynamics of migratory and sedentary populations.