  Chemically peculiar Ap and Bp stars host strong large-scale magnetic fields
in the range of $200$~G up to $30$~kG, which are often considered to be the
origin of fossil magnetic fields. We assess the evolution of such fossil fields
during the star formation process and the pre-main sequence evolution of
intermediate stars, considering fully convective models, models including a
transition to a radiative protostar and models with a radiative core. We also
examine the implications of the interaction between the fossil field and the
core dynamo. We employ analytic and semi-analytic calculations combined with
current observational constraints. For fully convective models, we show that
magnetic field decay via convection can be expected to be very efficient for
realistic parameters of turbulent resistivities. Based on the observed magnetic
field strength - density relation, as well as the expected amount of flux loss
due to ambipolar diffusion, it appears unlikely that convection could be
suppressed via strong enough magnetic fields. On the other hand, a transition
from a convective to a radiative core could very naturally explain the survival
of a significant amount of flux, along with the presence of a critical mass. We
show that in some cases, the interaction of a fossil field with a core dynamo
may further lead to changes in the surface magnetic field structure. In the
future, it will be important to understand in more detail how the accretion
rate evolves as a function of time during the formation of intermediate-mass
protostars, including its impact on the protostellar structure. The latter may
even allow to derive quantitative predictions concerning the expected
population of large scale magnetic fields in radiative stars.
