ABSTRACT The microbiome inhabiting the surface of leaves is essential for supporting forest health and productivity. Yet, the relevance of host selection and neighbourhood conditions in supporting phyllosphere microbial diversity remains poorly understood. Here, we used a large‐scale forest biodiversity experiment in subtropical China to elucidate the mechanisms driving phyllosphere microbial diversity. Our results showed that bacterial diversity depends more on plant traits associated with resource‐acquisitive strategy, while fungal diversity was more closely related to the trade‐off between plant productivity and defence. Additionally, bacterial diversity was highly structured by neighbourhood tree competition, whereas fungal diversity was mainly shaped by host plant functional traits. Furthermore, the relationship between microbial diversity and host traits was enhanced as tree species diversity increased. Together, our work provides novel evidence that tree competition plays crucial roles in promoting microbial diversity in the phyllosphere and highlights the importance of plant–microbe interaction in supporting ecosystem sustainability.