Alternators work by converting mechanical energy from the engine into electrical energy to power the vehicle's electrical system and charge the battery. The alternator is driven by a belt connected to the engine, and it consists of a rotor, stator, and voltage regulator. As the engine spins the alternator rotor, it creates a magnetic field that rotates around the stator. This rotation induces an alternating current (AC) in the stator windings, which is then converted to direct current (DC) by the diodes in the voltage regulator. The voltage regulator also controls the amount of voltage that the alternator produces, ensuring that it remains within a safe range for the battery and electrical system. The electrical energy produced by the alternator is then used to power the vehicle's lights, radio, and other electrical components, while also charging the battery.