“The voice coil component of a speaker is actually just an electromagnet. Electromagnets are coils of wire, and they're normally wrapped around some kind of magnetic metal, like iron. By running an electrical current through the wire, you produce a magnetic field surrounding the coil; this field magnetizes the metal in the middle creating north and south polar orientations. The difference between an electromagnet and a permanent magnet is that you can switch the polar orientations on an electromagnet by reversing the current's flow.
Stereos use this property of electromagnets to repeatedly reverse the electrical flow. The amplifier switches the signal over and over, making the red output wire on the stereo switch between positive and negative charges. The voice coil's electromagnet is placed within a permanent magnetic field. The two magnets interact, and every time the electromagnet's polarity changes, the interaction between the magnets changes. When the magnets are repeatedly repelled and attracted, they move the coil back and forth quickly, kind of like the piston in an engine. The moving coil presses and pulls on the speaker cone and vibrates the air in front of the speaker. This creates sound waves via a driver that vibrates the diaphragm.”