This question already has an answer here:
An audio port on a MBP is a combination output. If you plug in 4-conductor 3.5mm connector (TRRS) like the one on Apple earbud with microphone, it appears that that port can be use as an input.
I just bought a bare male TRRS audio jack. (without cable, it is for soldering your own) When I plug just that into the MBP, the MBP did not change the output to "External Microphone" as when I plugged an earbud with microphone to it. So I am wondering how did the hardware detects the mic? Does it communicate with the other end by some means?