As I understand it the currently accepted theory in relation to planet's magnetic fields is that some planets no longer have magnetic fields.
The theory goes that the magnetic field is created by the molten core of the planet that is in constant motion. The magnetic field serves to deflect a large proportion of the solar radiation spewing from the sun. When a planet's core cools and solidifies it stops producing the magnetic field and solar radiation quickly strips away that planet's atmosphere. This is the current theory on what happened to Mars' atmosphere and water (Mars' core cooled quicker than Earth's because Mars is smaller).