There are various mechanisms by which the kidney produces concentrated urine. The most important of these are the loop of Henle and the role of ADH, anti-diuretic hormone. Let's examine each of these in turn.
The role of the loop of Henle is to create a very low (very negative) water potential in the tissue of the medulla to ensure that even more water can be reabsorbed from the fluid in the collecting duct. The loop of Henle consists of a descending limb that descends into the medulla and an ascending limb that ascends back out to the cortex. The arrangement of the loop of Henle allows sodium & chloride ions (salts) to be transferred from the ascending limb to the descending limb. The overall effect is to increase the concentration of salts in the tubule fluid & consequently they diffuse out from the thin-walled ascending limb into the surrounding medulla tissue, giving the tissue fluid in the medulla a very low (very –ve) water potential. This allows more water to be reabsorbed from the tubular fluid into the medulla down the water potential gradient further along the nephron.
ADH is also crucial in varying the permeability of the walls of the collecting duct, a region further along the nephron, to water. When the water potential of the blood is low, neurosecretory cells (osmoreceptors) are stimulated in the hypothalamus, causing release of ADH from the posterior pituitary. This allows the secretion of ADH to vary according to the conditions of the body, in this case with the water potential of the blood. The more ADH that is secreted, the more permeable the walls of the collecting duct become and the more water is reabsorbed from the fluid in the nephron into the blood. Thus less water is excreted in the urine, producing a smaller volume of concentrated urine.