Why is Mercury so far from the Sun?

Why is Mercury so far from the Sun?

Roughly half of all planetary systems have planets much closer to their stars than Mercury is to our Sun. Can a system’s magnetic field during the stage of planet formation explain why half of all systems (including our own) do not have these planets when the other half do?