* Gas-powered cars: A gasoline engine powers the car, and a generator connected to that engine produces the electricity that powers the car's electrical systems.
* Electric cars: A battery stores electrical energy, and this battery powers the car's electric motor.
* Hybrid cars: A combination of a gasoline engine and a battery power the car. The gasoline engine typically charges the battery, while both power the car's electric motor.
So, to answer your question more directly:
* Gas-powered cars: The gasoline engine provides the initial power, and the generator turns that mechanical energy into electricity.
* Electric cars: The battery stores the electricity directly.
* Hybrid cars: Both the gasoline engine and the battery provide electricity, depending on the driving situation.