It would seem that the end with 3 black rings should be in the music device, and the end with 2 black rings goes into the headphones. The 3rd ring on the device end is for a microphone input. Since the cord has a mic built into the cable, the mic wire only needs to go from the mic to the device (i.e. phone, tablet). The headphone end of the cable only needs 2 rings (left and right audio), because when using the cable, the microphone on the cable serves as the only mic input.
-3 ring --> phone, tablet, laptop
-2 ring --> headphones