Electrolytes are ions that carry an electrical charge and travels in and out of cells. The most common types of electrolytes in your body are sodium, potassium, calcium, chloride, and magnesium.
Electrolytes trigger an event called action potential. Action potentials are the signals your brain transmits through neurons to parts of your body to contract the muscle. The principal ions involved in action potentials are sodium and potassium. As these two ions travel in and out of cells, the cells' charge switch back and forth from negative to positive. The switching process carries through the entire axon, out the axon terminals, and communicates with other neurons. The same process continues until the switching signal reaches the muscle fiber. Then calcium ions flood the muscle fiber, which causes the muscles to contract. If you don't have enough electrolytes, your muscle contractions are weaker and inefficient. You can get a lack of potassium from excessively drinking or throwing up. Dehydration can cause low levels of sodium. Electrolytes don't just cause action potentials. For instance, calcium helps with bone density and blood clotting. Magnesium helps enzymes function. Chloride helps sodium transfer water in and out of cells.