SummaryPlant community productivity commonly increases with increasing plant diversity, which is explained by complementarity among plant species in resource utilization (complementarity effect), or by selection of particularly productive plant species in diverse plant communities (selection effect). Recent studies have also shown that soil biota can drive the positive plant diversity–productivity relationship by suppressing productivity more in low‐ than in high‐diversity plant communities. However, much remains unknown about whether soil fertility plays a role in determining how soil biota affect plant diversity–productivity relationships.We hypothesized that under high soil fertility conditions, negative soil biota effects dominate, which reduces plant monoculture biomass more than that of high‐diversity plant communities. Conversely, under low soil fertility conditions, we hypothesized positive soil biota effects dominate, which facilitates plant resource partitioning and enhances community‐level biomass in high‐diversity plant communities. Hence, we expected positive plant diversity–community productivity relationships under low and high soil fertility conditions but caused by different mechanisms.We tested these hypotheses using woody seedlings and set up plant assemblages with four species richness levels (one, two, four and eight species), and grew them in sterilized and unsterilized (sterilized soil + living soil inoculum) soils at two nutrient levels (low versus high fertility).We found that at high fertility negative soil biota effects dominated and suppressed plant community biomass more in high‐diversity plant communities than in monocultures, resulting in reduced complementarity effects of diverse plant communities and a non‐significant plant species richness–community biomass relationship in unsterilized soil. Whereas at low fertility soil biota had net neutral to positive effects on plant community biomass but the beneficial effects did not increase with increasing plant species richness. Instead, soil biota neutrally affected the positive plant species richness–community biomass relationship, presumably due to non‐specific effects of beneficial soil biota.Synthesis. Soil biota and soil fertility interactively determine plant species richness–community biomass relationships. Moreover, soil biota modulate the complementary resource use among plant species. These findings suggest that environmental context plays an important role in determining whether and how soil biota generate the biodiversity–productivity relationship. Future studies would benefit from revealing the mechanisms underlying the interactive effects of soil biota, soil fertility, and plant diversity on ecosystem functioning.