when current flows through the coil it creates a magnetic field around the coil, the magnetic field from the coil interacts with the magnetic field of the permanent magnet, producing a force on the coil, when the ac current in the coil changes direction it reverses the direction of the force, causing the coil to oscillate, in a loudspeaker this causes the oscillations produce soundwaves