Biodiversity-function relationships in ecosystems are known to be driven by environmental conditions, including climate change. Plant functional groups (PFGs), specifically their evolutionary history, nitrogen-fixation capacity or photosynthetic-pathway likely play a critical role in shaping microbial communities and their impact on ecosystem functions, but experimental evidence is limited. Here, we simultaneously manipulated plant and microbial diversity in a microcosm study to investigate their interactions and impact on soil functions during drought. Our results highlight the dominant role of PFGs in explaining the effects of biodiversity loss on soil functions. Microbial diversity loss significantly influenced microbially-driven soil N and P pools and processes, with PFGs moderating these effects, especially under drought. Our findings offer crucial mechanistic insights for ecosystem management in the face of climate change, emphasizing the significance of PFGs in shaping soil functions and their resilience. This study underscores the importance of considering above- and belowground biodiversity, for preserving belowground functions in changing environments.