Alternators work by converting mechanical energy from the engine into electrical energy. The alternator is driven by a belt that is connected to the engine's crankshaft. As the engine turns, the belt drives the alternator's rotor, which is a spinning magnet. The rotor spins inside a stationary set of coils called stator windings. The magnetic field created by the rotor induces an alternating current in the stator windings. This alternating current is then converted to direct current (DC) by a diode rectifier.
The DC current from the alternator is then used to charge the battery and power the vehicle's electrical accessories. The battery provides power to the vehicle when the engine is not running. The electrical accessories include things like the headlights, taillights, windshield wipers, and radio.
In gasoline engines, the alternator also provides power for the ignition system. The ignition system uses a spark plug to ignite the air/fuel mixture in each cylinder. The spark plug is powered by the alternator, which provides the high voltage needed to create a spark.
Without an alternator, a car's engine would not be able to run. The alternator is a vital component of a car's electrical system.