Magnetic fields protect a planet from the charged particles streaming out from the Sun in the form of the solar wind. The particles are deflected outwards by the magnetic field lines. Earth has a strong magnetic field because it has a liquid conducting core composed of iron-nickel that rotates swiftly every 24 hours. read more
Only two planets have no permanent magnetic field. In order: Mercury has a magnetic field. It's not super strong (possibly because it rotates fairly slowly), but it does exist. Venus does not have a magnetic field. We're fairly sure the core is liquid metal, so for some time scientists believe it lacked a magnetic field because it rotated too slowly. read more