A hypothesis that seeks to explain the allocation of a plant’s resources to defensive substances in terms of the relative availability of carbon and major nutrients, particularly nitrogen. When carbon (produced by photosynthesis) is in excess, as when a plant is growing in nutrient-poor soil, part of the excess is allocated to the production of carbon-based secondary metabolites, such as terpenes and phenolics, which act as deterrents to herbivores. When nitrogen is in excess, for example when a plant grows in the shade or when fertilizer is used, the plant uses some of the excess to make toxic nitrogenous metabolites, such as alkaloids. The hypothesis is controversial, and experimental evidence is often contradictory, suggesting that the reality is more complex; some have called for its abandonment.