When you have sex with a partner, you're opening yourself up to bacteria and other microscopic substances that can end up irritating your vagina and causing an infection.