Magnesium has a key role in triggering vitamin D, which in turn controls bone development and regeneration. All enzymes that metabolize vitamin D appear to require magnesium, a cofactor in the enzymatic reactions of the liver and kidneys.
While magnesium is an essential cofactor in the synthesis of vitamin D, in turn activated vitamin D increases the intestinal absorption of magnesium, thus maintaining its homestase. (The Journal of the American Osteopathic Association) (National Institute of Healt/ Office of Dietary Supplements: Magnesium Fact Sheet for Health Professionals - Sources of Magnesium: Food)