Since magnesium is mostly on the surface of bones, the correlation between the level of magnesium in bone and the resistance of bones to breakage is probably indirect.
If bodily pools are adequate to very good, magnesium deposits on the surfaces of bones.
If bodily pools of magnesium are adequate to very good, so are many nutrients that parallel magnesium, and overall, metabolism -including inner bone metabolism and the breakdown and rebuilding of bones- simply runs better.
When bodily pools of magnesium are inadequate, so are its correlates (including other nutrients), metabolism is off, and bone deposition of magnesium decreases, and as bones are continually remodeled, the level of magnesium in bone decreases.
that’s what Occam’s razor was, an excuse for oversimplifying problems, though no fault of Occam, who clearly understood it to be parsimonious (sufficient complexity, given the intrinsic complexity of the problem and nature in general), not oversimplifying in nature. When scientific insight or statistical analysis of association/correlation clearly suggests two or more variables, we should treat the problem as multivariate, and use computers to model the phenomenon if we have to.
Instead, we oversimplify and see univariate causality everywhere.
Causality is an extreme case. Minimally, causality is a necessary and sufficient condition for the occurrence of the effect.
In reality, the cause is S.I.N. – sufficient to produce the effect all on its own (irresistible force, extremely rare indeed), necessary to produce the effect (nothing else can produce the same effect, a very strong statement, obviously not common either), and it immediately precedes the effect (the immediacy prevents interferences from obscuring the causal relationship, instantaneous is also extremely rare – natural processes take time to unfold).