The purpose of a microphone is to turn sound waves into electrical signals that can be amplified and recorded. This is done through the use of a thin diaphragm that vibrates in response to sound waves. The diaphragm interacts with a magnet and that generates an electrical voltage. It’s actually the exact reverse of what a loudspeaker does.
A device that converts one form of energy into another is called a transducer and “condenser” and “dynamic” are types of transducer which gives them their name.
A condenser microphone uses a transducer that’s based on variable capacitance. What’s important to know is that a condenser is very accurate, fragile and requires powering to boost the signal. A dynamic mic is much simpler, using a coil of wire and a magnet to induce the electrical voltage. What’s important to know is that dynamic microphones are less sensitive, robust and do not require powering.