Kidney and urinary tract infections may be caused by  bacteria invading the  urine, which is normally a sterile body fluid. Bacteria most commonly gain  access to the urine through the urethra, which can be exposed to bacteria from  outside of the body. 
Common sources of bacteria invading the urinary system are the vagina, anus,  and skin. Because of the shorter length of urethra in women, urine infection is  more common in women compared to men. There are some factors that may predispose  people to urinary tract infections.
Sexual intercourse may increase the risk of urine infection in women. Kidney  infection may be facilitated by the introduction of bacteria from outside  (vagina) to the urinary system through the urethra.
Pregnant women may also be at higher risk for developing develop urinary  tract infections. This may be caused by slower transit of urine from the ureters  into the bladder because of increased pressure on the ureters from the enlarged  uterus. Approximately  10% of pregnant women may develop kidney and urinary tract infections during  their pregnancy.
Kidney stones are another factor that may increase the  likelihood of urinary tract infection. Stones can cause partial or complete obstruction to the flow of urine from the  kidneys and ureters. This obstruction may act as a focus of infection in the  urinary system, leading to urinary tract infections.
Bladder catheters (Foley catheters) are sometimes placed into the bladder in  order to aid the outflow of urine from the bladder. These are used in many  settings, for example, paralysis with nerve damage to the bladder causing  accumulation of urine without adequate emptying, bladder obstruction from an  enlarged prostate, or immobilized or hospitalized patients who are not able to  independently urinate. These catheters may act as a vehicle for bacteria to gain  access to the urine inside the bladder causing urinary infections.
In children some risk factors include female gender, an uncircumcised male,  or a structural abnormality of the urinary system.
The most common bacteria causing urinary tract infection or kidney infection  are naturally those that may be seen in the vagina, gastrointestinal tract, or  skin. By far, the most common organism causing urinary tract infection is  Escherichia coli (E.  coli), responsible for up to 80% of kidney and urinary infections. Other common  bacteria include  Klebsiella, Proteus, Pseudomonas, Enterococcus, and  Staphylococcus saprophyticus.

