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).
ENGADGET: Self-aware headphones switch channels depending on which ear they're in (video)