As a simple driver of cars, I've never understood why no one has mass produced an EV with a built-in generator. That would avoid the complexity of the hybrid drive train, allow easy plugin and short range electric-only travel, and could even be offered as an optional attachment. So what am I missing? Is the efficiency gained by the generator offset by losses through the EV system?
That is called a series hybrid and the reason they're not popular is that the power split device in common hybrids is simply better.
The power split device isn't an ordinary transmission, it's a set of planetary gears with a fixed gear ratio between three shafts. One goes to the wheels, the other two to the engine and the electric motor respectively. The ratio of the engine speed to the wheel speed is then set by the speed of the electric motor connected to the third shaft, which gives you a CVT with no belts, clutches, torque converters or even synchros.
The transmission is "more complicated" only in the sense that it contains electric motors. In every other respect it's simpler, more efficient and more reliable than an ordinary transmission. Meanwhile those electric motors mean you don't need a starter motor or an alternator because the engine can be started by the electric motor through the transmission and an electric motor is a generator when operated in reverse.
A series hybrid still requires you to have a gas engine with all that entails, but now the gas engine needs its own dedicated electric generator/motor and you can't deliver power from the gas engine directly to the wheels, so the traction motors have to be bigger in order to supply 100% of the torque used in acceleration instead of the gas engine and electric motors both contributing. That makes series hybrids heavier, slower and more expensive, so they're basically useless. Probably the main advantage would be that you could offer the generator as an option on what would otherwise be a full electric vehicle and then only people who need the extra range would pay for it.
Wouldn't an additional advantage of series hybrids be that the engine can be tuned to operate solely in it's most efficient RPM band, since it just charging the battery and doesn't need to deal with changing speeds? This can (according to some very cursory googling), result in efficiency gains of 20-30% relative to the least efficient RPMs. This should at least partially offset some of the size and weight considerations, since you don't need to size the engine for it's energy output in less efficient speeds. This seems like it would be most important in stop-and-go conditions where the engine is spending considerable time at less efficient speeds, such as in a bus.
The parallel hybrids can already do that because of the CVT.
In practice they also allow the engine to run at higher speeds under heavy acceleration because the peak efficiency RPM and the peak power RPM are different and the assumption is that if the driver is stomping on the accelerator they want to resolve the power/efficiency trade off in favor of power right now, which is another thing the series hybrids can't do.
This was the GM Volt, predecessor to the Bolt: https://en.wikipedia.org/wiki/Chevrolet_Volt GM ceased production in 2019. The answer to your question can probably be found there, but IIRC [from GM's perspective] the consumer market preferred ICE + battery over electric + generator, especially after the all-electric options came to market and siphoned demand from the latter.
It just turns out not to be worth it. The generator is a lot of weight to add, and a whole bunch of new parts to maintain.
It's a lot easier to add enough batteries to match the range of an ICE car. Range anxiety is largely manufactured at this point. The cars know how far they can go and where the chargers are. A gasoline powered generator would be a huge extra cost with no real upside other than averting a non-problem.
Edison Motors is working on a system like this. They're looking to sell kits for retrofitting it onto pickup trucks, & a larger scale semi truck cab version for use with logging trucks. It looks great in their videos, although I'm not sure if they're selling to the public yet - probably a ways to go before it's really mass produced.
Most BYD PHEVs work like that - with the additional option of connecting the engine directly to the wheels via a clutch at highway speeds. I think Honda has a similar system.
You're talking about PHEVs, basically. Ramcharger is an example of one where the ICE engine only charges the battery; it's not connected to the drivetrain.