That’s a loaded question!
If i remember correctly, Mark Dismore wrote a pretty good article that is on his shop’s website on this topic.
Generally speaking, magnesium are lighter (lower rotational mass) and don’t heat up as quickly, or get as hot as a result. This keeps the tire pressure more consistent throughout a longer run (i.e. a race).
Aluminum will heat up quicker, which can be advantageous in cooler conditions. Aluminum is also less brittle. I cannot recall ever seeing an aluminum rim with a chunk out of it, but have seen many mag rims missing chunks.
Also, if you’re on a crg or crg made kart the front bolt pattern is different (same size as a rear) i don’t think any other manufacturers do this.
Never heard of a track mandating one type over an other, but if your son is racing Jr he’s probably got to run 6’s