Magnetic fields in neutron stars: A theoretical perspective