And thats more effiicient how exactly?
Gearing. A generator can run continuously at a specific RPM that is optimal. You can very easily vary the power given in an electrical motor because we're pretty darn good at moving electrons. This is the thing about all motors, not just car motors. In an ideal situation you run at a fixed RPM for as long as possible at a specific gear ratio that maximizes the power delivered versus the torque delivered based on application. If you're looking for maximum power, you minimize torque as much as possible.
Except you cannot do that in a moving vehicle because you need to modify that torque when going from speed to stop or form stop to speed. This stopping and getting back up to speed is a massive drain of efficiency on a moving vehicle because the best we can do is the gearbox, which isn't the most effective but most effective given we want to minimize weight. But in an electric generator we can spin at a fixed RPM because we only need to stop the motor when the battery is charged and we can spin at the correct RPM and gear ratio to maximize power because, we don't need a massive amount of torque, because we aren't moving the car with the motor, just the generator.
And the same is true for generators at nuclear plants, hydro plants, for water pumps in a muni watering system, and so on. There is a reason why water towers exist, it is because we can run the water pumps at their ideal parameters for longer to deliver maximum cubic feet of water per minute. When the load on the water system goes down, the pumps are delivering a surplus volume of water, and so we fill the tank. When the load goes up, the pump isn't delivering enough volume into the system, so we drain the tanks. The point being the pump spins with ideal parameters through all of it, we just use the tanks to maintain or supplement as we carry on. Any time we have to vary from continuous parameters pretty much the whole "things in motion really dislike being coaxed into non-motion" kicks in and at scales that provide us power and water at the city level, every time those parameters fluctuates, shortens the life, just a little bit, of the very expensive pumps that you want to exist for as long as humanly possible. So it's massively cost effective to have water pumps, storage tanks, whatever, to ensure those pumps stay as ideal as possible. If a water tower costs your town about $3M for break ground-to-online but reduces variance in your pumps by 5%, that $3M is recouped in about two years. So if your town needs a water tower and the pumps are not in their last five to ten years, putting up the tower makes a lot of economical sense even in the worst of cases.
Trains have been using this mixture of diesel / battery design for decades now. And it's total effect is that trains go longer between repairs, stay on the rails longer, and require less refueling between stops. And in really difficult terrain, some trains are hybrid, in that the battery and fuel can both turn the axle. This is how cars like the Prius can achieve such insane MPGs, because the motor attempts to run at any of the ideal parameters for the given gear and if you need less, rather than slow the motor down, it charges the battery. Motor running in the ideal configuration for longer means more of the fuel going in is power and not heat.
Anything with a motor, you want spinning at it's ideal parameters for as long as possible to maximize the desired effect. And any motor that varies those parameters a lot, requires lots of maintenance and upkeep to keep it running. Hence why oil changes are really important in car engines. They're important in utility motors as well, but can be done a lot less frequently than a car motor because the motor is being ran ideally for longer periods of time with way less variation in the input parameters. The dynamic nature of a car motor is one of the biggest factors in design considerations that sets automotive motors apart from other motors.