Magnetars are neutron stars displaying the most intense magnetic fields observed in the Universe. To tackle the still-open question of the origin of these extreme magnetic fields, a scenario was proposed by a team from the Department of Astrophysics (DAp) at CEA Saclay, invoking the Tayler-Spruit dynamo mechanism, triggered by matter falling onto the young neutron star after the supernova explosion.