The kidneys filter blood to produce urine through microscopic nephrons. The nephron consists of Bowman's capsule which filters everything except blood cells and plasma proteins into the proximal tubule. Useful substances like glucose, water, and salt are reabsorbed into the bloodstream in the proximal tubule. Dangerous substances are secreted into the distal tubule. The filtrate then passes through the collecting duct where more water is reabsorbed through diffusion due to higher salt concentrations, leaving mainly urea and other waste to be excreted through the urethra.