UTIs are a key reason we're told to wipe from front to back after going to the toilet. That's because the urethra - the tube that transports urine from the bladder to the outside of the body - is located close to the anus. Bacteria from the large intestine, such as E. coli, are in the perfect position to escape the anus and invade the urethra.
From there, they can travel up to the bladder, and if the infection isn't treated, continue on to infect the kidneys. Women may be especially prone to UTIs because they have shorter urethras, which allow bacteria quick access to the bladder. Having sex can introduce bacteria into the urinary tract too.