What causes a kidney infection?

Kidney infections usually occur when bacteria enter your urinary tract through the urethra.

Bacteria from an infection anywhere in your body can spread through-out your bloodstream into your kidneys, yet that is quite uncommon.

Source