Ever since I started running, all I know is that I need to drink a sh*t ton of electrolytes. But I would like to understand why on a physiological level.
When you’re exercising you’re sweating. In addition to water, sweat has a lot of electrolytes in it. That is why sweat is salty.
Water is the most important thing you need when hydrating, but you benefit more if you can replenish your electrolytes as well.
Your body needs electrolytes in order to sweat. At a high level (I am DEFINITELY not an expert), your body uses the presence of those electrolytes in your sweat glands to draw moisture out of the body in order to sweat and regulate your temperature.
Electrolytes are also used in many other things, like muscle control (like how people say to eat a banana to avoid cramps, Potassium in Bananas are an electrolyte), so if you sweat out too much from exertion without replenishing them, you will start to have issues.
The fluid in your cells contains electrolytes (mostly sodium and potassium chloride). Nature dislikes different concentrations of things to be around each other so it will try to make the concentrations the same. Sometimes this happens by moving the salt from one liquid to another but sometimes it can’t do this, but can move water. This process is called osmosis.
If you drink a lot of water then the cells will be more salty than the rest of your body and draw water into them. This leads to the cells swelling and ultimately bursting.
Additionally to the electrolytic balance mentioned in other comments, consider that the only way your body retains water and regulates blood volume is by binding it to certain electrolytes, like sodium and potassium. If you’re deficient in those, there are many negative effects.
Specifically when discussing hydration, there are sodium-deficient people who are chronically dehydrated, regardless of how much water they consume. They just pee too much of it out, and their body retains too little. High-sodium diets and electrolyte drinks are normal when trying to correct for deficiencies like that.
Your sweat isn’t just water. It’s electrolytes, like salt, and water, you need to replenish both to keep the water in your body isotonic to stop it from messing with cellular function.
It’s the same reason hospitals use saline for hydration instead of just water.
However, you probably have enough salt in your diet that plain water is fine for hydration.