Generally it's a process transferring from electricity to viberation and eventurally to sound, the below diagram (from Loyal institution Science lives here) and the picture shows exactly in brief the structure of a Speaker and how a speaker with permanent magnet works.