One of the main functions of the kidneys is to excrete waste products such as Urea produced by the liver. They also regulate the water potential of the blood.
Blood enters the kidney through therenal artery and then passes through the capillaries in the cortex.
As blood passes, substances are filtered out of the blood into long tubules that surround capillaires (ultrafiltration)
Useful substances are reabsorbed into the blood in the medulla and cortex - selective reabsorption
Any unwanted substances that are filtered out pass along th etubules, then along the ureter to the bladder, where they're expelled as urine.
The filtered blood passes out of the kidneys through the renal vein.