The widely used biofilm process in advanced wastewater treatment is currently challenged by numerous exotic emerging pollutants (EPs), and the underlying principle of the challenge is the adaptive evolution laws of biofilm under EP stress. However, there is still a knowledge gap in exploration of the biofilm adaptive evolution theory. Herein, we comprehensively analyzed the morphological variation, community succession, and assembly mechanism of biofilms to report the mechanism underlying their adaptive evolution under sulfamethoxazole and carbamazepine stress for the first time. The ecological role of the dominant species was driven as a pioneer and assembly hub by EP stress, and the deterministic processes indicated the functional basis of the transformation. In addition, the characteristic responses of dispersal limitation and homogenizing dispersal adequately revealed the assembly pathways in adaptive evolution and the resulting structural variation. Therefore, the "interfacial exposure−structural variation−mass transfer feedback" mechanism was inferred to underly the adaptive evolution process of biofilms. Overall, this study highlighted the internal drivers of the adaptive evolution of the biofilm at the phylogenetic level and deepened our understanding of the mechanism of biofilm development under EP stress in advanced wastewater purification.