The kidneys can be split into 5 main sections. Firstly we have the glomerulus. Blood enters the kidneys via the afferent arteriole and then travels to the glomerulus which is just a cluster of capillaries. The presssure inside the glomereulus is very high due to the small lumen of the capillaries and this leads to small molecules such as water, salt and glucose being forced out of the glomerulus, into the Bowman's capsule to form the glomerular filtrate. This then enters the next section of the kidneys - the PCT. The PCT is covered in microvilli which provide a large surface area meaning that glucose can be reabsorbed into the blood at a much faster rate. The filtratre then enters the loop of henle. Sodium ions are actively transported out of the ascending limb of the loop of henle which lowers the water potential of the blood in the medulla. This means that water moves out of the descending limb (the ascending limb is impermeable to water) by osmosis and is reabsorbed into the blood. The pumping of sodium ions out of the loop of henle also lowers the water potential of the blood around the DCT so water also moves out of the DCT by osmosis and is reabsorbed into the blood.
Finally, the collecting ducts also play an important part in homeostasis. The hypothalamus produces a hormone called ADH which increases the permeablitiy of the collecting ducts by increasing aqua porin formation. This means that when the water potential of the blood is low, more ADH is released so that more water can be reabsorbed into the blood from the collecting ducts, resulting in more concentrated urine.