When the car is in motion, power from the gasoline engine is split between the drivetrain — to move the car — and the generator, which uses the
resultant electricity either to drive the electric
motor to help turn the
wheels or to power electronics, as well as to charge the battery, which can then be used to drive the car on its own.