Why do earphone pieces repel each other when music is on? I know it has to do with electricity flowing and generating a magnetic field, but I would like a thorough explanation (with perhaps a picture). In particular:


*

*What is in the ear piece?

*Why do they repel as opposed to attract?

*How come my ear buds don't seem to do it?


Thanks in advance!
 A: Because the loudspeakers in your earphones (or at least @Marek's) contain some permanent magnets. To make a long story short, the magnetic field produced by the current is used to move the permanent magnet according to the music you're hearing. Then, the details depend on the specific technology your earphones use, as you can check with http://en.wikipedia.org/wiki/Earphone#Technology (with diagrams)
A: What is in the ear piece?
Normally there is a small magnet, a loop of coil and a diaphragm. The current going through the coil is modulated so that it makes the coil move in the magnetic field and the diaphragm, which is attached to it. The movement of the diaphragm generates the sound.
Why do they repel as opposed to attract?
Because the two magnets are oriented the same way.
A longer and more interesting answer is the following. Most modern music has monaural lower frequencies. This is because the kick drum and the bass in rock and pop are positioned in the centre of the audio spectrum.
Now, the lower frequencies are the ones that need more electromagnetic energy, because they need to push more air - the wavelength is longer - and they are in-phase between the two ear pieces. 
So in practice, when you listen to music, you feel more force pushing outwards. If you were to listen to music with out of phase basses, you would feel less force.
How come my ear buds don't seem to do it?
For a number of reasons.


*

*they are smaller, therefore there are smaller forces involved

*the diaphragms are smaller and the earbuds are therefore built to have far less low frequency response 

