Why are the Geographic North pole and the Magnetic North pole of the Earth so close together?

I understand that they are different.
I understand that the magnetic south pole of the Earth is the one that we call the north pole because that’s where our compasses point.
I understand that the magnetic north moves.

But why are they so close???
Is it just random chance that the top and bottom of the Earth has a giant magnetic field on almost, but not exactly, the top and bottom of the Earth?