The magnetic field ( see magnetism ) that surrounds and permeates the Earth . It is the presence of this field that causes compass needles to line up in a north-south direction. The origin of the Earth's magnetic field is poorly understood at the present time.