How does my iPhone know which headphone cable I plug in?
An line-level input, which is what your car's aux in jack is, presents a relatively high impedance to the source - generally 10k ohms. Your 'phones have a much lower impedance, typically 32 ohms for PMP phones. It's possible to distinguish between them in that way.