Your alternator converts mechanical energy to electrical energy with an alternating current. The stator and rotor inside the alternator work as magnets and rotate to generate the alternating current. Then the alternating current(AC) is transformed into a direct current(DC) that charges the battery.