They used carbon dust with a thin diaphragm on one side. Movement of the diaphragm changes the resistance of the carbon dust by compressing it. By running a current through the carbon dust, the change in resistance changes the current flow. Dynamic microphones uses a diaphram that moves either a magnet or a coil when sound waves hit the diaphragm. This movement creates a small current.
Ribbon microphones uses a small ribbon suspended in a magnetic field.
Sound waves that move through the ribbon changes the current flowing through it. Condenser microphones can be considered a capacitor. One plate moves in response to sound waves and changes the capacitance to the capacitor. These changes are then amplified to a measureable signal. Condenser microphones need a small battery to provide voltage across the capacitor.