As sound waves hit the diaphragm they compress the carbon dust, which changes its resistance. By running a current through the carbon, the changing resistance changes the amount of current that flows. See How Telephones Work for more information. In a dynamic microphone the diaphragm moves either a magnet or a coil when sound waves hit the diaphragm, and the movement creates a small current. In a ribbon microphone a thin ribbon is suspended in a magnetic field.
Sound waves move the ribbon which changes the current flowing through it.
A condenser microphone is essentially a capacitor, with one plate of the capacitor moving in response to sound waves. The movement changes the capacitance of the capacitor, and these changes are amplified to create a measurable signal. Condenser microphones usually need a small battery to provide a voltage across the capacitor. By attaching a diaphragm to a crystal, the crystal will create a signal when sound waves hit the diaphragm. The one thing they all have in common is the diaphragm, which collects the sound waves and creates movement in whatever technology is creating the signal.