  [abbreviated] Long-lived, large-scale magnetic field configurations exist in
upper main sequence, white dwarf, and neutron stars. Externally, these fields
have a strong dipolar component, while their internal structure and evolution
are uncertain, but highly relevant for several problems in stellar and
high-energy astrophysics. We discuss the main properties expected for the
stable magnetic configurations in these stars from physical arguments, and how
these properties may determine the modes of decay of these configurations.
Stable magneto-hydrostatic equilibria are likely to exist in stars whenever the
matter in their interior is stably stratified (not barotropic). These
equilibria are not force-free and not required to satisfy the Grad-Shafranov
equation, but they do involve both toroidal and poloidal field components. We
argue that the main mode of decay for these configurations are processes that
lift the constraints set by stable stratification, such as heat diffusion in
main-sequence envelopes and white dwarfs, and beta decays or particle diffusion
in neutron stars. In the former, heat diffusion is not fast enough to make
these equilibria evolve over the stellar lifetime. In neutron stars, a strong
enough field might decay by overcoming the compositional stratification through
beta decays (at the highest field strengths) or through ambipolar diffusion
(for somewhat weaker fields). These processes convert magnetic energy to
thermal energy, and they occur at significant rates only once the latter is
smaller than the former, and therefore they substantially delay the cooling of
the neutron star, while slowly decreasing its magnetic energy.
