It is thought neutron stars with the correct mass may change into quark stars and then finally into Magnetars. Quarks however come in three different flavors. If one particular one dominates a thing called “color ferromagnetism” might occur and this what causes the powerful magnetic fields of a Magnetar.
Magnetars are quite interesting on their own. They have all sorts of exotic properties. In Dec 27, 2004 a gamma ray blast from one of these babies was strong enough to send gamma ray detectors off the charts and change the earths upper atmosphere:
Because a magnetar has a extremely strong magnetic field, they are also thought to have a thing called an electron cloud that flows around the magnetar (star):