  A fraction of young neutron stars, magnetars, have ultra-strong magnetic
fields. Models invoked for their strong fields require highly specific
conditions with extreme parameters which are incompatible with the inference
that the magnetar birth rate is comparable to the rate of core-collapse
supernovae. We suggest that these seemingly contradictory trends can be
reconciled if the toroidal magnetic fields are subject to oscillations
following the proto-neutron star (PNS) dynamo stage. Depending on the phase of
the oscillation at which the oscillations are terminated, the neutron star can
have a very high ($\gtrsim 10^{15}\,{\rm G}$) or relatively small ($\sim
10^{14}\,{\rm G}$) toroidal field. As an example, we invoke a shear-driven
dynamo model for the generation of PNS magnetic fields and show that the
toroidal field indeed exhibits oscillations following the dynamo stage. We
argue that these Alfv\'enic oscillations can lead to the formation of both
magnetars and ordinary neutron stars depending on at what phase of the
oscillation the fields froze.
