Detecting Planetary Magnetism
A magnetometer is an instrument for measuring magnetic fields. Many spacecraft carry magnetometers to measure the magnetic fields around planets they orbit or fly by. When a spacecraft takes such measurements, what do they tell us about a planet?
The planet might have a global magnetic field surrounding and permeating it. Earth does, which is why compasses work. So do Mercury, Jupiter, Saturn, Uranus, and Neptune. Electrical currents in Earth's core generate its magnetic field. The core consists of iron and nickel, which are good conductors of electricity. Similarly, Mercury has an iron core which produces its field. Areas surrounding the solid cores of Jupiter and Saturn consist of liquid metal hydrogen, which exists only at the intense pressures and temperatures found deep inside massive gas giant planets. Flow of electricity in the liquid metal hydrogen produces the powerful magnetic fields Jupiter and Saturn. The magnetic fields of Uranus and Neptune are generated by current flow in slushy brine deep within, but not at the core of, those frozen gas giants.
The planet might have localized magnetic fields on, through, and around limited areas. Perhaps the planet had a global magnetic field in the past which has now gone extinct as the planet aged and cooled. Remnants of the former field can stay "locked into" rocks formed during those earlier times. Mars and Earth's Moon seem to have such localized magnetism. Large deposits of ores such as iron could influence a magnetometer's readings near the deposits. Such deposits could even be the remains of an iron-rich asteroid that struck the planet, embedding its magnetic field into the planet along with its material!
The spacecraft also might detect magnetism associated with, one way or another, the solar wind or the Sun's magnetic field. The solar wind, the flow of electrically charged particles emitted by the Sun, carries the Sun's magnetic field outward through the Solar System. The spacecraft's magnetometer might directly detect the Sun's magnetic field, even when the spacecraft is near a planet, because the Sun's field is so strong. Charged particles from the solar wind can also become trapped within a planet's magnetosphere, if the planet has one, and the movement of the particles within the magnetosphere can generate magnetic fields detectable by a spacecraft. Also, a planet might emit charged particles from its surface (Mercury does this) or atmosphere (as does Venus). The interaction of the solar wind with such particles is another possible source of magnetic fields that the spacecraft might detect.
Finally, the magnetic field detected by a spacecraft might be a combination of fields produced by several of these effects. For example, the magnetic field near Earth is a result of the combination of Earth's global field, "fossil" magnetism embedded in rocks from eras when Earth's field was different than it is today, charged particles racing around Earth's magnetosphere, and other factors.