A dynamic microphone operates like a speaker in reverse. The diaphragm is moved by changing sound pressure. This moves the coil, which causes current to flow as lines of flux from the magnet are cut. So, instead of putting electrical energy into the coil (as in a speaker) you get energy out of it.