Magnesium oxide packs a lot of elemental magnesium into a small dose, but the body absorbs little of it. Most of it stays in the gut, where it pulls in water and softens stool. That makes it a cheap option for occasional constipation. Take it with food to avoid stomach upset.
For raising magnesium levels in the rest of the body, other forms work better. High doses often cause cramping, diarrhea, or general digestive discomfort.