Sodium effect in rehydration
Sodium is an alkali metal with only one isotope essential for all animal life (including humans) and for some plant species as well.

It is such a vital element that herbivorous land animals have developed a special taste receptor for this electrolyte and it has been classified as a “dietary inorganic macro-mineral” for animals.
All known higher lifeforms require the maintenance of a precise osmotic gradient of electrolytes. Such gradients affect and regulate the hydration of the body as well as blood pH, and are critical for nerve and muscle function. This electrolyte balance is maintained by oral, or in emergencies, intravenous (IV) intake of electrolyte-containing substances, and is regulated by hormones, generally with the kidneys flushing out excess levels.
When sweating or urinating, liquid excretion (basically water) mixed with salts dissolved in it is produced, and there you can find primary electrolytes as physiologic vitals as Sodium (Na+), Potassium (K+), Calcium (Ca2+), Magnesium (Mg2+), Chloride (Cl−), hydrogen phosphate (HPO42−), and hydrogen carbonate (HCO3−) which may enter or leave the cell membrane through specialized protein structures.
Once the concepts are introduced, we should focus on the question: how does the Sodium help in rehydration?
Well, Sodium is the main cation in the extracellular liquid and it mainly takes part it water distribution control, balance of fluids and electrolytes and their osmotic pressure. Fluid from the body is normally pumped into the intestinal lumen during digestion and it contains a high concentration of sodium (approx. 142 mEq/L). A healthy individual will secrete 20-30 grams of sodium per day via intestinal secretions but nearly all of this is reabsorbed by the intestine together with the liquid that contains it (basically water), helping to maintain constant sodium levels in the body. So, if the blood volume falls down (like in an hemorrhage or in dehydration), the reabsorption of Sodium is greatly increased in order to reestablish the equilibrium in the organism and so is water reabsorption and also in a heavy continuous diarrhea the liquid secreted into the intestinal lumen during diarrhea passes through the gut so quickly that very little sodium is reabsorbed, leading to very low sodium levels in the body, correction of a this state can be accomplished by the replenishment of necessary water with electrolytes.
"Everything should be made as simple as possible, but not simpler." Albert Einstein