How Did the Earth and Moon Form? The Surprising Role of Magnetism