How do magnetars acquire fields of $1\mathrm{e}14\ \text{to}\ 1\mathrm{e}15\,\mathrm{G}$?
In plain words
The field could be inherited from a strongly magnetic parent star or amplified by a dynamo (stirring motions that regenerate magnetic field) during the collapse.
Precise statement
Determine whether magnetar dipole fields $B \sim 1e14\ \text{to}\ 1e15\ \mathrm{G}$ arise from flux conservation of fossil fields in magnetic massive stars (possibly stellar-merger products), from convective or magnetorotational dynamos in a proto-neutron star spinning at $P$ of a few ms, or from a fall-back-driven Tayler-Spruit dynamo. Answer: the channel or channels consistent with the magnetar birth fraction (estimates ~10 to 40 percent of neutron stars), ordinary supernova remnant energies and kick distributions.
What would settle it
Proto-neutron star dynamo simulations predicting field strengths and topology, compared with magnetar population statistics and remnant energetics.