You get a UTI when bacteria from outside your body enter the urethra and travel up into the bladder. About 60% of women and 12% of men will experience at least one UTI in their lifetime. The vast majority of infections are caused by E. coli, a bacterium that normally lives in the intestines and around the anus. When it migrates to the urinary opening and takes hold, infection follows.
How Bacteria Enter the Urinary Tract
The urinary tract is designed to keep bacteria out. The bladder lining has a protective layer of proteins and sugars that acts as a chemical barrier against bacterial attachment. The cells lining the bladder wall are tightly packed together, forming a physical shield. Urine itself flushes bacteria downward and out.
But E. coli has evolved to get past these defenses. The bacteria have tiny hair-like structures on their surface that latch onto receptor proteins on bladder cells. Once attached, the bacteria can actually invade the cells themselves, burrowing inside where the immune system has a harder time reaching them. This is one reason UTIs can recur even after treatment: bacteria hiding inside bladder cells can re-emerge weeks or months later.
For infection to happen, though, the bacteria first have to reach the urethra. That journey from the anus or surrounding skin to the urethral opening is where most risk factors come into play.
Why Women Get UTIs Far More Often
Anatomy is the single biggest factor. In women, the urethra is significantly shorter than in men, meaning bacteria have a much shorter distance to travel before reaching the bladder. The urethral opening is also close to both the anus and vagina, two areas that harbor bacteria. In men, the urethral opening sits at the tip of the penis, far from the anus and much farther from the bladder.
This positioning means bacteria from the digestive tract have easy access to the female urinary tract. It doesn’t take a hygiene failure or anything unusual. The normal movement of bacteria across skin and through daily activities is often enough.
Sexual Activity
Sex is one of the most common triggers for UTIs in women. The physical friction during intercourse can push bacteria from the skin around the genitals into the urethra. It can also irritate the urethral opening, making it easier for bacteria to gain a foothold. This is why UTIs sometimes spike in frequency when someone becomes sexually active or has a new partner.
The infection isn’t sexually transmitted in the traditional sense. Your partner isn’t passing an illness to you. The bacteria involved are already present on your own body. Sex simply provides the mechanical push that moves them to the wrong place. Urinating soon after sex helps flush bacteria out before they can travel upward.
Hormonal Changes After Menopause
Recurrent UTIs become much more common after menopause, and the reason is hormonal. When estrogen levels drop, the vaginal environment changes dramatically. The population of Lactobacillus bacteria, which normally keep the vaginal area acidic and inhospitable to harmful bacteria, declines. Without that protective barrier, E. coli colonizes the area more easily.
A study of 463 postmenopausal women found that E. coli colonization was more frequent in women not using estrogen replacement and was inversely associated with the presence of Lactobacillus. The vaginal lining also thins after menopause, reducing another layer of defense. Low-dose estrogen therapy has been shown to restore Lactobacillus populations and lower vaginal pH, which helps keep UTI-causing bacteria in check.
Pregnancy
Pregnancy creates several conditions that favor UTIs. As the uterus grows, especially between weeks six and 24, its increasing weight presses on the bladder and can partially block the flow of urine. When urine sits in the bladder longer than usual, bacteria have more time to multiply. Pregnancy also naturally suppresses the immune system to protect the developing fetus, which reduces your body’s ability to fight off infections early.
Diabetes and Immune Factors
People with diabetes face a higher risk of UTIs, and the reasons go beyond what researchers originally assumed. The traditional explanation was that excess sugar in the urine feeds bacterial growth. While that likely plays some role, animal studies have shown that even diabetic mice without elevated blood sugar still struggled to fight off bladder infections. This suggests that diabetes compromises the immune defenses of the urinary tract in ways that go beyond just sugar levels. A lower UTI in someone with diabetes also has a higher chance of progressing to a kidney infection.
Any condition that weakens the immune system, blocks urine flow (such as kidney stones or an enlarged prostate), or requires a urinary catheter raises UTI risk for similar reasons. Bacteria thrive when the body’s normal flushing and immune mechanisms are impaired.
Habits That Raise or Lower Your Risk
You may have heard that wiping back to front after using the toilet causes UTIs. The logic sounds reasonable: dragging fecal bacteria toward the urethra. But this turns out to be less clear-cut than commonly believed. Neither the American Urogynecological Association nor the American College of Obstetricians and Gynecologists includes wiping direction in their UTI prevention advice. Adults with normal motor control can generally limit contact to the intended area regardless of direction. And fecal bacteria are already present in the air around your genitals from the toilet bowl itself.
What does have solid evidence behind it is hydration. A 12-month clinical trial of 140 women with recurrent UTIs found that drinking an extra 1.5 liters of water daily (about six extra cups) significantly reduced recurrences. More fluid means more frequent urination, which flushes bacteria from the bladder before they can multiply and attach to the lining.
Cranberry products have a more modest reputation than marketing suggests, but they’re not useless. A meta-analysis of seven clinical trials involving nearly 1,500 women found that cranberry reduced the risk of recurrent UTIs by 26%. That’s a meaningful reduction, though not a guarantee. Cranberries contain compounds that may interfere with bacteria’s ability to stick to the bladder wall. The benefit appears most relevant for otherwise healthy women who get frequent infections, not as a treatment for an active UTI.
What’s Actually Happening During an Infection
Once bacteria establish themselves in the bladder, they multiply rapidly and trigger inflammation. This is what produces the hallmark symptoms: a burning sensation when you urinate, the urgent feeling that you need to go constantly, and passing only small amounts each time. Your urine may look cloudy or have a strong smell. Some people notice pink or red-tinged urine from minor bleeding in the irritated bladder lining.
If the infection stays in the bladder, it’s called cystitis, and it’s uncomfortable but usually straightforward to treat. If bacteria travel further up through the ureters to the kidneys, the situation becomes more serious. Kidney infections typically cause fever, chills, back or flank pain, nausea, and a general feeling of being quite ill. This progression is more common in people with diabetes, structural urinary tract issues, or weakened immune systems.
Most bladder infections clear with a short course of antibiotics, often within a day or two of starting treatment. Kidney infections require longer treatment and sometimes hospitalization. The key distinction for recognizing escalation is the onset of fever and pain in the back or side, which signals the infection has moved beyond the bladder.