The primary function of the loop of Henle is the recovery of water and sodium chloride from the urine.