Magnesium assists in the activation of vitamin D, which helps regulate calcium and phosphate homeostasis to influence the growth and maintenance of bones. All of the enzymes that metabolize vitamin D seem to require magnesium, which acts as a cofactor in the enzymatic reactions in the liver and kidneys.