I have frequently sufffered from cramps when doing longer rides, 50 miles and up, and now always use an electrolyte mix at the max recommended concentration in my water bottles. For extra long rides 100+ miles I have also taken magnesium a couple hours ahead of time and usually had few problems. Even if cramps are not well understood, a couple of things we know, hydration is important, and sweating causes you to lose salts which water alone can not replace...