Simulations suggest that two enormous masses of hot rock have been involved in generating Earth’s magnetic field and giving it an irregular shape