What Causes Charley Horses?

Charlie horses occur either when a muscle is hit suddenly, or when the body is deficient in vitamins. In particular magnesium and/or potassium.