Magnetosphere is the magnetic field created by the earth's core by heating the ionized iron particles and discharges it at the north pole and south pole, it protects the earth from sun solar wind charge particles, when the charged particles collides with the magnetosphere it absorbed some charged particles and that's why aurora created.