All magnetism arises due to the same factor - electric current.
The Earth’s magnetic field similarly arises due to electric currents in its core - caused by the motion of molten metals like iron and its alloys present in the fluid outer core.
This formed magnetic field is also carried through mantle. That is, magnetic field in core is coupled with mantle. The range of magnetic field in mantle is more than that in core.