Mercury, being much smaller than Earth and having a solid iron core, does not have the same type of magnetic field as Earth. Mercury's magnetic field is very weak and is thought to be generated by the movement of liquid iron in its outer core. However, the exact mechanism that generates Mercury's magnetic field is still not fully understood and is an active area of research.
The differences between the magnetic fields of Earth and Mercury reflect the different structures and interiors of the two planets. Earth has a larger, liquid iron core and a faster rotation, which together generate a stronger magnetic field. Mercury, on the other hand, has a smaller, solid iron core and a slower rotation, which result in a much weaker magnetic field.