The relationships between biodiversity and ecosystem functions (BEF) are crucial for ecosystem management. However, little is known about how grazing affects BEF relationships in the context of ecological succession. Here, using a 5-year experiment in a semiarid grassland of the Loess Plateau, China, we mainly focused on how grazing affected the relationships between plant species diversity and aboveground biomass (AGB) and explored the underlying mechanisms behind the relationships. In addition, we compared the plant dynamics of community composition and structure under no-grazing and grazing treatments during succession. We found that the plant species diversity-AGB relationship shifted from a negative-linear pattern in no-grazing to a humped-back model in grazing during plant community succession, suggesting that grazing could regulate dominant species and alter the availability of light resources to suppress competitive exclusion during succession. In addition, changes in annual plants over time played crucial roles in the BEF relationships. The increase in annual Salsola collina in this study, which also alters multiple mechanisms of plant interaction, had a significant effect on the negative-linear relationship both with and without grazing. On average, compared to no-grazing treatment, grazing significantly decreased the plant community density (39.53 %), cover (16.97 %), height (7.85 %), and AGB (9.35 %), but increased plant diversity, including species richness and the Shannon–Wiener index, and especially dramatically enhanced the Shannon–Wiener index (ranging from 1.55 to 2.13). These results underline the close association between grazing and the dynamics of plant communities in semiarid grasslands during succession. In particular, our findings further reveal grazing-dependent relationships between diversity and AGB, which have significant implications for the management and biodiversity conservation measures of semiarid grassland ecosystems.