A back-and-forth motor
A loudspeaker turns electrical signals back into sound using the same force as an electric motor. The signal flows through a coil of wire — the voice coil — attached to a paper or plastic cone and sitting in the gap of a strong permanent magnet.
Current in the coil makes it a temporary magnet, pulled toward or pushed away from the permanent magnet depending on the current's direction. The audio signal changes direction thousands of times a second, so the coil and cone vibrate in exactly the pattern of the original sound.
Pushing air
The cone's job is to move air. Pushing forward, it compresses the air in front of it; pulling back, it thins it. Those alternating squeezes travel outward as sound waves, with the cone's speed and reach deciding the volume.
Big, slow movements make deep bass notes, which is why bass speakers are large; small, light tweeters handle the rapid vibrations of high notes. Many speakers split the signal between several drivers, each sized for its share of the range.
From headphones to concert halls
A headphone is the same machine shrunk to centimetre size, moving tiny puffs of air directly into the ear canal — which is why it needs so little power to sound loud. A concert stack is the opposite: ranks of large drivers moving air for thousands of people.
The design is a century old and barely changed, because it is hard to beat: a coil, a magnet and a cone, faithfully copying an electrical wiggle into the air. What you hear as music is the cone's obedience, thousands of pushes per second.

