Abstract Biogeochemistry and population biology have developed independently, with few attempts at linkage, almost none of which were mechanistically based. We hypothesize that biogeochemical cycling is linked to herbivore population dynamics through the influence of soil nutrient availability on foliar nutrient content, which constrains herbivore investment in phosphorus (P)-rich molecules necessary for growth. We show that variation in desert soil P availability is linked to abundance of an insect herbivore (Sabinia setosa) through the influence of soil P on the C:P ratio of the host plant (Prosopis velutina). Low P availability increases C:P ratio of Prosopis leaves, leading to a decline in body %P, %RNA and abundance of Sabinia. Tight association between soil, plant and herbivore P provides the first evidence of a mechanistic pathway linking P biogeochemistry to terrestrial food webs by altering the supply of dietary P to herbivores, thus limiting their capacity for growth by constraining the production of P-rich cellular ribosomal RNA (rRNA).