the solar wind comes close to the Earth it is deflected
by the Earth’s magnetic field. This leaves
us protected in a bubble almost free from the solar
wind. It’s a bit like sitting on the beach
behind a wind-break.
Even though the Earth’s magnetic field is very steady, the protective 'bubble' around the Earth is constantly changing size and shape because of changes in the magnetic field, density and speed of the solar wind.
Imagine putting a rock in a stream. The magnetic bubble around the Earth is similar in shape to that of the flow of water around the rock in the stream.
How far does the magnetotail go? I don’t know...I’m working on that! We know it’s somewhere between 13 and 20 million km away
Here is an animation of the Earth being battered by the solar wind. It is based on real data from space. The solar wind is flowing in from the left. The blue circle shows what the auroral ring looks like.
The magnetic field in front of the Earth is squashed by the solar wind. The magnetic field behind the Earth stretches out to form a long magnetic tail reaching out into space...it's called the magnetotail for obvious reasons!