A car engine functions with the help of air, spark, and fuel. Electricity, necessary to generate the spark, is supplied by the battery in small amounts. However, since it is not a large amount, the alternator steps in to ensure that the battery is constantly charged, and the car keeps running.