The biodiversity–ecosystem functioning (BEF) relationship is central in community ecology. Its drivers in competitive systems (sampling effect and functional complementarity) are intuitive and elegant, but we lack an integrative understanding of these drivers in complex ecosystems. Because networks encompass two key components of the BEF relationship (species richness and biomass flow), they provide a key to identify these drivers, assuming that we have a meaningful measure of functional complementarity. In a network, diversity can be defined by species richness, the number of trophic levels, but perhaps more importantly, the diversity of interactions. In this paper, we define the concept of trophic complementarity (TC), which emerges through exploitative and apparent competition processes, and study its contribution to ecosystem functioning. Using a model of trophic community dynamics, we show that TC predicts various measures of ecosystem functioning, and generate a range of testable predictions. We find that, in addition to the number of species, the structure of their interactions needs to be accounted for to predict ecosystem productivity.