I will discuss possible pathways for the origin and evolution of magnetic fields in early type stars. The strong surface magnetic fields observed in OBA stars are stable and have relatively simple geometries. These fields are likely inherited or created during or shortly after star formation (fossil fields). Alternatively some could be produced during a stellar merger event. Weak surface magnetic fields are now also observed. These fields could be failed fossils or be generated by a contemporary dynamo in the stellar envelope. Such dynamo can tap into the energy provided by stellar differential rotation in radiative zones and/or the kinetic energy of convective motion in subsurface convective layers. Finally, internal magnetic fields could also be very common in the convective cores of OBA stars, which are likely to be rotating rapidly.
This notion is supported by asteroseismic observations of evolved low-mass stars, which also point towards efficient angular momentum transport in stellar interiors. Indeed such coupling might be provided by internal magnetic fields. Predicting the rotation rate and the magnetization of compact remnants (WDs, NSs and BHs) requires that we understand the coupled evolution of magnetism and angular momentum transport in early type stars.