how do we know that the magnetic field is a product not just the iron core of the Earth but perhaps large quantity of selected molecule in the atmosphere? Nitrogen or oxygen?
Earth's magnetic field follows the flow of magma inside Earth (not the solid iron core). There would not be any pole reversals if the magnetic field was created by something constant like the distribution of molecules in Earth's atmosphere.
https://www.nasa.gov/topics/earth/features/2012-poleReversal...