The Earth's magnetic field and oxygen evolved together over 540 million years, according to a major NASA study.