A dynamic microphone acts like a generator. A sound wave is a pressure wave. As sound hits the diaphragm, areas of high pressure (compressions) push the diaphragm in. And areas of low pressure (rarefaction) pulls it out. As the diaphragm moves, the coil moves too. This causes a potential difference to be induced into the wires. This is the "electrical signal" a microphone produces.