The infection is caused by microorganisms that enter the body through the vagina during sex. The microorganisms travel up thorough uterus and into the inside of the body. There are many microorganisms that cause infection in this way, such as: