Vitamin D
The active form is called calcitriol (specifically 1,25-dihydroxyvitamin D). The inactive forms are called cholecalciferol (vitamin D3) and ergocalciferol (vitamin D2). The inactive form can be produced when certain sun rays make direct contact with the skin. Dietary sources and supplementation tend to also contain the inactive form. The inactive forms are processed by the liver where it is converted into calcidiol (specifically 25-hydroxyvitamin D). Then it is processed by the kidneys where it is converted into its active form, 1,25-dihydroxyvitamin D.
Magnesium is necessary for its conversion to take place, used in the production of vitamin-D-activating enzymes.1 Vitamin D has also been observed to have an inverse correlation with parathyroid hormone.2
Protein synthesis
Apart from helping to absorb and regulate blood calcium levels, vitamin D is necessary for synthesizing many kinds of protein. Any body-builder or anyone with lung injury, gut problems, infection, etc, that leaves this nutrient out of their diet or lifestyle does themselves a disservice. Skeletal muscle, gut lining, lung lining, bladder lining, etc, are all proteins influenced by vitamin D.
Toxicity and related deficiencies
This only applies to supplements. Although vitamin D itself isn’t considered toxic, if vitamin D supplementation isn’t coupled with vitamin K2, blood calcium levels may rise to toxic levels when taking vitamin D in large amounts. Since the body requires Magnesium to metabolize vitamin D into its active form, taking large doses of vitamin D can lead to Magnesium deficiency.3
During low levels of Magnesium the body could either induce bone resorption (i.e. take Magnesium from the bones) or will simply not convert vitamin D into its active form. If not converted, the vitamin will either hang around in the body (waiting to be activated) or be excreted.