Optimal Foraging Theory (OFT) predicts that a population's trophic niche expansion should occur in periods of food scarcity as individuals begin to opportunistically exploit sub‐optimal food items. However, the Niche Variation Hypothesis (NVH) posits that niche widening may result from increased among‐individual differentiation due to food partitioning to avoid competition. We tested these hypotheses through a DNA metabarcoding study of the Sardinian Warbler (Curruca melanocephala) diet over a year. We used null models and the decomposition of beta diversity on among‐individual dietary differentiation to infer the mechanisms driving the population's niche variation. Warblers fed frequently on berries, with a peak in late summer and, to a lesser extent, in autumn. Their diet also included a wide range of arthropods, with their prevalence varying among seasons. Consistent with OFT, the population's niche width was narrower in spring/summer when the population was strongly specialized in berries. In winter, the population's niche expanded, possibly reflecting seasonal declines in food abundance. As predicted by NVH, among‐individual differentiation tended to be higher in winter, but this was mainly due to increased differences in dietary richness rather than to the partitioning of resources. Overall, our results suggest that within‐individual niche does not increase in lean periods, and instead, individuals adopt either a more opportunistic or more specialized foraging strategy. Increased competition in periods of scarcity may help explain such patterns, but instead of showing increased food partitioning as expected from NVH, it may reflect OFT mechanisms on individuals with differential competitive ability to access better food resources.