This is what I can think of, in my limited knowledge. Overlaps with some existing answers. Trying to limit to things that aren't obvious, also trying to think of direct physical causes rather than things that may or may not trigger certain ECU software to make an explicit shutdown decision (I assume there's a lot of variation here, so it's kinda hard to cover all cars, plus that's more of a symptom than a cause):
- Faulty ignition switch / loose wiring.†
- Loose/failing power input to ignition coil.
- Electrical faults (short / open) in ignition coil.
- Loose/failing ignition wire.
- Failing distributor cap / rotor† (maybe? do they have transient failure modes?)
- Faulty crankshaft position sensor / loose wiring.
- Enough loose/failing spark plug wires that misfires lead to stalling.
- Fouled or faulty spark plugs.
- Clogged fuel filter.
- Faulty fuel pressure regulator.
- Fuel pump power issue (ranging from wiring to perhaps a loose or semi-blown fuse).
- Fuel pump overheating (perhaps due to e.g. failing bearings, failing pump, etc.)
- Fuel injector faulty wiring (in systems with EFI).†
- Any conditions leading to momentarily improper fuel trim, e.g.:
- MAP/MAF sensor failure or faulty wiring leading to momentarily improper fuel trim.
- Any other faulty sensors (TPS, O2, thermostat esp. when engine cold, etc.) / faulty sensor wiring leading to the same thing.
- Leak in intake downstream of MAF sensor.
- Vacuum leaks.
- Failed or failing ECU.
- Idle air control valve faulty wiring.†
- Defective speed sensor (leading to failure to idle when vehicle stopped).
- Obstruction in intake (perhaps it shuts down at high rpms but you can still start it, or the obstruction moves around or clears itself). Perhaps as simple as a dirty air filter.
- Obstruction in exhaust, e.g. back pressure from a clogged or failing catalytic converter that clears when the engine stops.
- Faulty EGR valve wiring.†
- Coolant leaks, air in coolant lines can throw off the ECT sensor causing the engine to behave poorly and possibly stall (source is personal experience).
- In cars with smaller engines, or cars that are having other problems and running on the border anyways, anything that puts an unexpected load on the engine esp. when it is idling (e.g. too much electrical load + a possibly inadequate/failing alternator, power steering issues if stalled while turning, things like that).
- Also wiring faults leading to e.g. the ECU failing to notice that the A/C has been turned on.
- I'm sure fuel quality issues / impurities that get past the fuel filter must be on this list somewhere but I don't know specifics.
- In automatics: Low automatic transmission fluid (causing excess engine load from torque converter at low driving speeds) or failing torque converter.
- In carbureted engines:
- Water in various components e.g. driving through a large puddle (may count as "obvious" though).
Also some vehicle-specific issues, for example:
For all of the "faulty wiring" things above, the fault could be in a number of locations:
- Connectors at the components
- Wiring near the components
- Buried in the wiring harness or connectors elsewhere
- Fuse boxes, etc.
- Also electrical contact failure in the component itself, even though this may not commonly count as "wiring". I'd probably call that a "failed component" rather than "faulty wiring", myself.
In the above lists, general internet consensus seems to identify the most common causes of intermittent stalling as:
- Faulty sensors
- Vacuum leaks
- Intake leaks / obstructions
- Fuel obstructions.
Uh... I'm sure there's more, I'm trying to work this out in my head from what I know about engines. I know nothing about diesel. I also know nothing about carbureted fuel systems, or turbo/super charged engines (although you could lump those in with intake issues, I guess), mechanical fuel injection, or hybrid cars.
I've excluded most overheat related issues since things just get weird, any number of strange things could start to happen (e.g. sensors malfunctioning out of their temperature spec, etc.) that clear when it is cool again - I feel like that list could be infinite; plus I'm counting overheating as "obvious" or at least "visible".
† More likely wiring or electrical faults, as mechanical failure of these components unlikely to be transient.