Electrolytes are important because they are what your cells (especially nerve, heart, muscle) use to maintain voltages across their cell membranes and to carry electrical impulses (nerve impulses, muscle contractions) across themselves and to other cells. Your kidneys work to keep the electrolyte concentrations in your blood constant despite changes in your body.
For example, when you exercise heavily, you lose electrolytes in your sweat, particularly sodium and potassium. These electrolytes must be replaced to keep the electrolyte concentrations of your body fluids constant. So, many sports drinks have sodium chloride or potassium chloride added to them. They also have sugar and flavorings to provide your body with extra energy and to make the drink taste better.