What causes an infection?

Most bacteria which cause infections enter via the urethra from outside, which is why using a catheter can increase the risk of infection. Anything which allows urine to stagnate in the bladder can help trigger infection.