How do car generators work?

A car generator is a DC motor.

If you apply power to a working DC motor, it will turn the armature and produce work.

If you turn the armature of a working DC motor, it will produce power.

Generators in cars were replaced during the early 1960's with alternators.