What does an alternator do?

An alternator is an electromechanical device that converts mechanical energy to alternating currant electrical energy.