The kidneys play important roles in filtering waste products like urea & uric acid out of blood, maintaining acid-base balance and sodium and potassium levels regulating blood pressure. They are located in the abdomen on each side of the spine. Urine formed in the kidneys passes through ureters to the bladder and finally goes out through urethra.
Reasons for kidney failure can be pre-renal such as short blood supply due to blood loss, dehydration (diarrhea, vomiting), and taking diuretics. Renal causes include infections of kidney/urinary tract, medications that are toxic to kidneys like NSAIDs (ibuprofen) or antibiotics like amino glycoside (gentamycin) or iodine-based medications and/or multiple myeloma or glomerulonephritis.
Post-renal causes like blocking of the urinary tract, intra-lumen (stones, tumor) or pressure from outside by cancer around the ureter can cause backflow of urine increasing pressure within the kidneys and affecting it’s function. Long-standing reasons for kidney failure can be diabetes, hypertension or stones.