The collecting duct's water permeability is regulated by antidiuretic hormone (ADH/vasopressin), which increases aquaporin-2 water channel expression via V2 receptor signaling, allowing water to reabsorb osmotically according to the osmotic gradient established by the loop of Henle. This is the final control point for urine concentration and plasma osmolarity.
The loop of Henle, which you have already studied, builds an osmotic gradient in the renal medulla — a concentration landscape that gets progressively saltier as you move deeper toward the papilla. But that gradient, by itself, does nothing to concentrate urine. The gradient is a tool; the collecting duct is where the tool gets used. The collecting duct runs from the cortex straight down through the medulla, passing through regions of increasing osmolarity. Whether water actually leaves the tubular fluid and enters that hypertonic interstitium depends entirely on one variable: the water permeability of the collecting duct wall.
By default, the collecting duct epithelium is nearly impermeable to water. Without a hormonal signal, water stays inside the tubule, and the kidneys produce large volumes of dilute urine — sometimes as dilute as 50 mOsm/kg. This is exactly what happens when you drink several glasses of water in quick succession: plasma osmolarity drops, and the body responds by withholding the hormone that would allow water reabsorption, letting the excess water flow straight through to the bladder.
That hormone is antidiuretic hormone (ADH), also called vasopressin, released from the posterior pituitary in response to rising plasma osmolarity or falling blood volume. ADH binds to V2 receptors on the basolateral surface of collecting duct principal cells, triggering a cAMP signaling cascade that causes intracellular vesicles containing aquaporin-2 (AQP2) water channels to fuse with the apical (lumen-facing) membrane. Once AQP2 channels are inserted, the apical membrane becomes freely permeable to water. Water then flows osmotically from the dilute tubular fluid (around 100 mOsm/kg leaving the distal tubule) into the hypertonic medullary interstitium (up to 1200 mOsm/kg at the papilla), and from there into the vasa recta capillaries for return to the circulation.
Think of it this way: the medullary gradient is like a sponge that has been pre-dried and is ready to absorb water. The collecting duct wall is a faucet that ADH turns on. With ADH present, water pours out of the collecting duct, the tubular fluid concentrates to match the surrounding interstitium, and the kidneys produce small volumes of concentrated urine. Without ADH, the faucet is off — water stays in the tubule regardless of how steep the gradient is. This is why diabetes insipidus (a condition of ADH deficiency or resistance) produces massive dilute urine output despite a perfectly functional medullary gradient: the osmotic engine works, but the valve that lets it pull water is stuck closed.