The presence of a magnetic field breaks the degeneracy, since it interacts in a different way with electrons with different quantum numbers, slightly modifying their energies. The result is that, where there were several configurations with the same energy, now there are different energies, that give rise to several very close spectral lines.
-------- d,e,fWith field
-------- a -------- b -------- c
-------- d -------- e -------- fWithout a magnetic field, configurations a, b and c have the same energy, as do d, e and f. The presence of a magnetic field splits the energy levels. A line produced by a transition from a, b or c to d, e or f now will be several lines between different combinations of a, b, c and d, e, f. Not all transitions will be possible -- see transition rules.