what is earth's magnetic field responsible for