There’s no connection that I’ve heard of between the sun’s magnetic field and the earth’s. That doesn’t mean there isn’t one.
And those moving charged particles flying through space from the sun... create a mag field. Seems reasonable that these sources would interact with the Earth’s mag field. Must reach some level of equilibrium.