Because on your computer the engineers purposely put a switch that can direct the signal to either the input hardware or the output hardware.
It's not a mic slot, it's a general analog I/O port with a 3.5mm form factor.