The Earth = a Giant Magnetic Dipole
Dipole, two poles
This dipole extends far into space (the magnetosphere), but is strongest near the surface.
Now, because it’s a dipole, its field obeys:
Magnetic field strength ∝ 1 / r³
so when you're flying in a plane
You’re increasing your distance from the source of Earth’s magnetic dipole
IT goes INVERSE CUBE LAW