Do you really think prehistoric women used to have permanently infected vaginas just because they didn’t have soap? Just like every other extetnal organ (and the gut), genitals have their own protective microbiome. Recently the research on gut microbiome has become the most famous, but other microbiomes are no less inportant. As long as the presence of beneficial bacteria vastly outnumber the bad bacteria, the infection doesn’t occur. Bacteria are present everywhere, no matter how sanitary you try to be, it’s impossoble to avoid them. When infection occurs, it’s not because of the presence of harmful bacteria but because the protective microbiome has been compromised in some way. And, sadly, for a lot of women it is. Bad diet can negatively affect microbiome, but there’s also hormonal contraceptives (that were shown to increase the risk of yeast infections by 50%), tampon use, washing vulva with soap (yes, any soap, even those “feminine soaps”), removing pubic hair, wearing pantyhose and taking bubble baths. Besides, if you get an infection once and use antibiotics and antifungals, they destroy not only the bad bacteria but the good ones too, so recurrent infections are likely to happen.
Penile infections are not uncommon in uncircumcised penises, but men tend to not screw with their microbiome nearly as much. Neither have I, which is most probably why my genitals are so very resilient and low-maintenance.