With hypomagnesemia, ‘hypo-’ means ‘lower’ and ‘-magnes-’ refers to magnesium, and -emia refers to the blood, so hypomagnesemia means lower than normal magnesium levels in the blood, and symptoms typically develop at a level below 1 mEq/L.
An average adult has about 25 grams of magnesium in their body. About half is stored in the bones, and most of the other half is found within cells.
In fact, magnesium is a really common positively charged ion found within the cell, second only to potassium.
A very tiny fraction, roughly 1% of the total magnesium in the body, is in the extracellular space which includes both the intravascular space - the blood vessels and lymphatic vessels, and the interstitial space - the space between cells.
About 20% of the magnesium in the extracellular space, which would be about 0.2% of the total magnesium, is bound to negatively charged proteins like albumin, but the other 80% or 0.8% of the total magnesium, can be filtered into the kidneys.
So inside the kidney, that magnesium gets filtered into the nephron, and about 30% gets reabsorbed at the proximal convoluted tubule, 60% gets reabsorbed in the ascending loop of Henle, and 5% get reabsorbed at the distal convoluted tubule. And that leaves only 5% to get excreted by the kidneys.
Magnesium levels can fall in a few situations. One scenario is when the nephron fails to reabsorb the magnesium that’s filtered out of the blood, which would mean more would be excreted in the urine instead of kept in the blood.
Magnesium reabsorption is mostly a passive process where the positively charged magnesium ion follows the electrochemical gradient and moves from the positively charged lumen into the cells lining the lumen which usually have a negative charge.
Now, loop and thiazide diuretics can disrupt that process, because they both make the lumen less positively charged, and this diminishes magnesium’s electrochemical gradient and causing more of the ions to stick around in the filtrate and get peed out.
Another sort of similar scenario is a genetic mutation affecting channels that regulate ion flow, which again could change the electrochemical gradient and cause more magnesium to stick around in the lumen and get peed out.
An example of this is Gitelman syndrome, where there’s a mutation in the gene coding for the Na-Cl cotransporters in the distal tubule.