The Earth has a magnetic field that extends into space and protects the planet. The magnetic field is generated by Earth's core and behaves like a giant bar magnet. It has a north and south magnetic pole that are located near the geographic poles but can wander over time. The magnetic field deflects solar winds and cosmic rays, protecting the atmosphere. It can be mapped and measured at different locations on Earth. Animals like birds are able to detect the magnetic field to aid navigation.