No, magnetic fields do not exist on all planets. The magnetic fields of the four gas giants are extraordinarily powerful. The Earth has a somewhat strong magnetic field, Mercury has an exceedingly weak field, while Venus and Mars have no detectable fields. Mercury's magnetic field is feeble due to its slow rotation. The only other planet outside of the solar system known to have a significant magnetic field is Uranus.
Planets are formed when gravitational forces between particles within a rotating cloud of dust and gas cause these particles to collapse under their own weight into spheres. As particles within the cloud collide with each other, they can be ground down into smaller pieces or melted together to form different elements. In most cases, particles join together to form rocks which may be similar to those found on Earth, but many others are created that are very different indeed! It is estimated that planets like the Earth form every year within our galaxy alone. Further out in space, astronomers have discovered planets around other stars. These planets are often much larger than Earth and take years, if not centuries, to complete their orbits around their stars.
It is thought that as particles collide they can become magnetized either naturally or by mechanisms still unknown to scientists. The formation of a planet may be associated with the generation of a large scale magnetic field, but it could also be that the initial conditions within the collapsing cloud of gas and dust determine whether or not a planet has a magnetic field.
However, when compared to those of the other gas planets, the magnetic fields of Earth, Mercury, and Venus are relatively weak.
Earth's magnetic field is generated by its liquid iron core, which floats within its solid outer shell or mantle. The core is mostly hydrogen with some helium and trace amounts of other elements. It has a density about equal to that of water. The core is surrounded by a thin layer of electrically conductive rock called "mantle" that extends down to about 660 km (410 miles). Beneath the surface, molten iron flows within the core, rising through the mantle to the surface where it creates a hot spot called the "magnetic equator".
The magnetic field protects us from some of the effects of cosmic radiation. This intense form of energy comes from various sources including supernovae explosions, black hole collisions, and activity on galaxy clusters. It can penetrate human skin, but not muscle or bone. It also causes electricity to flow along paths near to the surface of the planet, so we have electrical power even if the sun doesn't shine directly over our head.
The magnetic fields created by the flow of liquid metal at the cores of Earth and Mercury are the only ones in our solar system. The reason is that without these fields, iron inside Earth would be free to wander off into space. The magnetic fields protect Earth's atmosphere and surface waters from harmful particles from outside the planet.
Earth's core is made up of solid iron innermost, with a layer of liquid iron below it. This liquid iron flows continuously down through the outer part of the planet, creating its own magnetic field. If this flow of liquid metal were stopped or reversed, our world would become like Venus, a deadly greenhouse planet.
Because of this reason, scientists think that no other planet in the solar system has a significant amount of magnetic activity. Any other planets that do have a strong magnetic field must contain their core completely composed of ice. No iron, no magnetic field!
However, we know now that Mars had water flowing on its surface long ago. And some scientists believe that there might have been life able to support magnetism on another planet in the early stages of galaxy history. So, even though Earth's neighbors aren't likely to host life as we know it, they're still interesting objects in their own right.
Planetary magnetic fields are created by the interplay of inner conducting material convection (molten rock and metal) with the planet's own rotation. Venus' atmosphere is very dense so there is no need for a dynamo. Earth's magnetic field is strong enough to protect life as we know it.
The electromagnetic forces that act on charged particles in a magnetized plasma are different from those in an unmagnetized plasma. These differences can be used to explain how planets or other bodies acquire their magnetic fields.
For example, if Earth had no iron inside it would lose its magnetic field over time because there would be no current flowing through it to keep it active. But because it has a metallic core, the iron inside it generates a flow of electrons which creates a magnetic field.
The metallic cores of planets may have been created when comet or asteroid impacts melt the surrounding rock causing the metal to rise to the surface. The cores of the planets Mars, Mercury and Jupiter appear to contain significant amounts of metal. If all the mass of a planet were replaced by a solid core then it could have a large impact on its dynamics and possibly its evolution.
The origin of Saturn's magnetic field is less clear.
Jupiter, Saturn, Uranus, and Neptune all have magnetic fields that are significantly stronger than Earth's. Jupiter, with the highest magnetic field, is the champion. It has a magnetic field more than 100 times stronger than Earth's.
Earth's magnetic field is created by its iron core. But since these planets do not have solid cores, they must generate their own magnetic fields.
The reason we don't experience these planets as having any effect on our environment is because their magnetic fields are so strong that they overpower Earth's feeble one. From our point of view, they are like magnets with too much strength for their size.
Jupiter has such a large mass that it can create its own magnetic field even though it is made mostly of gas. All the other giant planets also have highly concentrated masses that allow them to create strong magnetic fields.
But aside from those five planets, most have weak or no appreciable magnetic fields. The only exceptions are Venus and Mars which have very powerful ones.
Venus has an extremely dense atmosphere composed of carbon dioxide (95%) with small amounts of other gases including oxygen (3%).
Venus now lacks a magnetic field, although some models suggest that the planet might have sustained a worldwide magnetic field until a billion years ago. The features of Earth's fluid, metallic core are assumed to be linked to the planet's global magnetic field.
However, other models suggest that the last episode of magnetic activity on Venus occurred hundreds of millions of years earlier than this. Thus, in these cases, it would appear that Venus lost its magnetic field long before it became oxygenated. Possible explanations include that its original dynamo failed or was disabled by an impact event.
The loss of its magnetic field would have made life as we know it impossible on Venus, because all forms of energy that are released by radioactive elements inside the planet's body could not be confined within the surface boundaries of the planet. Instead, they would have been released into space, causing the atmosphere to expand and be blown away over time.
In conclusion, despite many attempts, no one has been able to reproduce the planet-wide magnetic field of Earth using only chemical ingredients present in Venus' crust. Therefore, our understanding of how and when Venus lost its magnetic field remains speculative.