I'm no doctor, but as far as I understand it electrolytes are sodium and potassium, and they help your body get hydrated faster by helping you absorb water (more? Faster? Idk, one of the two.)
(Btw, you're supposed to drink gatorade and water for this purpose, of course gatorade ads don't tell you that part though. Nor will they tell you about Pedialyte which is better than gatorade for hydration, or Liquid IV which I'm trying out now so I'm reserving judgement until my testing is complete).