One earpiece holds a proximity sensor, which if it's pointing at your ear, pumps out the left-channel, if it's facing away from you, it pumps out the right channel (pictured).
When nearly 30 years ago Dr. Jacob Fraden invented an ear thermometer working on this second principle, the infrared light sensor was so large that he needed a narrow gold-plated reflective tube to channel the light from the ear drum to the sensor.