An alternator is an electrical generator in a car's engine that converts mechanical energy into electricity, functioning as the primary power source while the engine runs. It charges the battery, powers electrical systems (lights, wipers, electronics), and converts AC to DC via a rectifier.