As I understand it, potassium helps muscles retain water. Low potassium will reduce the amount of water your muscles retain and cause cramping. High/adequate potassium will allow the muscles to hold sufficient water to prevent cramping, but only if there is water to hold. If you are getting plenty of potassium, but not enough water, you'll still end up with dehydrated muscles and associated cramping.
This is based on my own research, which may or may not be valid. I am an engineer by trade, not a doctor.