The kidney performs several essential functions: regulating water and electrolytes; retaining vital substances while excreting wastes, toxins, and drugs; and maintaining acid-base balance. Urine formation occurs via glomerular filtration, selective reabsorption and secretion. Filtration produces glomerular filtrate that undergoes reabsorption, concentrating the filtrate into urine. The kidney also regulates blood pressure and red blood cell production through hormones like erythropoietin, calcitriol, and components of the renin-angiotensin system.