The earth has a strong dipolar magnetic field, as if there was a large bar magnet in the core. In fact, electrical currents in the churning, liquid outer core produce a self sustaining dynamo. The influence of the magnetic field extends beyond the planet. The field meets charged particles streaming from the sun in a shock wave about 50,000 Km above the Earth and slows them from 400 to 250 Km/s. the solar wind, as these particles are known, sweeps the Earth’s magnetic field into a six million Km tail. Solar flares on the surface of the Sun result in magnetic storms on Earth two days later. There are belts of solar particles trapped in the magnetic field about 3000 and 25000 KM above equator, called the Van Allen belts.
Aurora occur where charged particles trapped by the Earth’s magnetic field stream towards the poles. The earth’s magnetic axis is 11degree west of the North Pole and is slowly wandering Eddy currents in the core and magnetism trapped in rocks produce local anomalies. In the geological past, the magnetic field has reversed many times. Between 118 and 83 million years it did not reverse at all. For the last few million years it has reversed about once in every 220000 years, revealed by the magnetic alignment in volcanic rocks. We are overdue for another reversal.