Personally I'm not 100% convinced that electolytes or being nearly de-hydrated doesn't lead to cramps - I believe there is some truth there but don't know how much.
I do believe that Gatorade and stuff doesn't do as much as they claim, but it seems common sense you have to have enough water in you and other minerals/elements/electrolytes. Basically get enough fluids before the race/run, etc ... and eat some good nutrition ....
For me ... I got leg cramps last Tuesday jogging on the treadmill - but I had done 45 minute aerobics class before that, sweated a lot. Probably a combination of just finishing a tough workout consisting of a lot of jumping up and down and lifting up on your toes (using the calves), and water loss through sweating. I didn't drink much during or after the aerobics.
Only made it .25 mile before the cramps hit - slowed and walked a few minutes drank water .. then slowly began to jog for 1.25 miles.
Fast-forward to yesterday. I drank a bottle and a half of water about 45 minutes before my run (a real run outside on a track), plus only 10 minutes in the sauna first (a little sweating but not like from the aerobics class), then I ran 3.21 miles (actually ran 6 laps, walked 1 lap, ran last 5 laps. This track has 12 laps = 3.21 miles).
I had no cramps, but .... also ran a little slower ... so ... was it the extra water ahead of time, the slower pace ... or ... Both ???? I think it was a little of both.
About slower pace ... what really happened is I seemed to take smaller steps or shorter strides but actually made quicker strides ... as in more steps per minute .... I dunno know if this correct or not.
When I got fitted for the shoes, the marathon-runner sales rep said to go faster you usaully take quicker steps first ... and eventually build up to longer strides and then long strides at quicker pace.
So, when I felt like I was headed for a cramp or leg trouble ... I took a wee bit shorted stride but picked up the pace of the steps a little ... and lo and behold was able to complete the 3.21 miles.
Confused? I am!