A microchip on the earbud senses in which ear it's placed
The L and R labels on your headphones serve a purpose, and it isn't just about fit. The audio source - whether it's a receiver, PC or MP3 player - sends left- and right-channel sounds to the appropriate earbud. While it might seem minor, this can be a difference between a disjointed experience listening to music, movies and other video, to a fuller experience that connects sight (in the case of video) and sound - with sound coming from the direction it's intended. There's no chance of a mix-up with the Universal Earphones being developed by Igarashi Design Interfaces Project in Tokyo - the headphones decide for themselves which ear they are in, and send sound to the each channel accordingly.