How The Earth Got Its Magnetic Field (And Why It Might Not Protect Us Much Longer)