Look down at the loop of wire. When electric current goes around the loop clockwise as you look at the loop, there is a south magnetic pole nearest you. When the current reverses there is a north magnetic pole nearest you.
When the south magnetic pole of a magnet is near the coil of wire it will attract a north pole and repel a south pole of the coil electromagnet. The coil will move toward and away from the magnet, depending on the direction of the electric current. Because the coil is attached to the cup, the cup will also move toward and away from the magnet.
The cup pushes air back and forth, creating a sound that travels to your ear. The bare wire itself does not move much air, so it does not make much sound. However, if the coil is attached to a large, low-mass material, it will vibrate that material which, in turn, will vibrate the air, making a louder sound.
Inside almost every speaker there will be a magnet, a coil of wire, and a thin material to convey the sound into the air. The invention of strong rare-earth magnets allows speakers to create more sound using less electric current.