Many people don't know this, but magnesium deficiency is a big problem today. Many people could reduce leg cramps and even blood pressure by supplementing with this inexpensive nutrient.
The regular dose for most shouldn't exceed 400mg. Many people, or larger people, can tolerate 1000mg per day, in a divided dose. Take with food. Too much can cause diarrhea. Just think milk of MAGNESia...
This mineral relaxes muscles, including those of the colon and blood vessels, as well as regular muscles. This explains the effect.
Years ago it was plentiful in produce from soil and drinking water. Today it is not as plentiful. Supplementation is necessary for most.
Hope this helps.