These bacteria work by adhering to the vaginal epithelial cells and forming a protective barrier. They compete with harmful bacteria for nutrients and space, effectively outnumbering them. Some beneficial bacteria also produce hydrogen peroxide, which further contributes to the antimicrobial environment.