Nothing to do with the software but the hardware. To put it simply (because I am not capable of the deep detail) it is down to the thing that is expect to be plugged in;
Headphone socket expects to have headphones which are low impedance and draw significant curent to operate.
Line out expects to be connected to a line in which is high impedance and draws no current to speak of.
The difference determines the nature of the output amplifier, they perform best when connected to the kind of device they were designed for - connect the wrong type and you'll most likely still hear something but the frequency response, etc won't be as good.