Stalling while driving is a fundamentally different problem from stalling at a junction, and it should be treated more seriously. At idle the engine is barely sustaining itself and small disturbances can stop it. At forty miles an hour it is running comfortably with plenty of momentum, so something has actively interrupted it. That points at a supply being cut rather than an idle being marginal.
Why is this more urgent?
Because of what you lose at the moment it happens. Power steering assistance disappears immediately, so the wheel becomes very heavy. Brake servo assistance lasts for two or three pedal presses and then the pedal becomes extremely hard. On some cars the steering lock can engage if the ignition switches fully off. Losing all of that at speed, in traffic, is genuinely hazardous, which is why intermittent stalling should not be lived with while you wait to see whether it settles down.
What are the most common causes?
A failing crankshaft position sensor is top of the list, because it tells the management where the pistons are, and without that signal fuelling and ignition stop instantly. These sensors classically fail when hot and work again once cooled, which produces a car that cuts out after half an hour, refuses to restart for twenty minutes, then drives home perfectly. That pattern is close to a diagnosis on its own.
What about fuel supply?
A failing fuel pump, a faulty pump relay or a corroded connector at the tank can all interrupt supply momentarily. The distinguishing feature is usually that the engine falters, stumbles or loses power briefly before dying, rather than switching off cleanly. A blocked filter behaves similarly under sustained load. A pump that is on the way out often gives earlier warnings through surging at motorway speed, which is worth remembering if that has been happening.
Can it be electrical rather than engine related?
Frequently. A worn ignition switch can lose contact momentarily, particularly over bumps or when the steering column is jolted, and the symptom is an engine that cuts cleanly as though the key had been turned. A failing main relay does the same. A chafed wiring loom shorting intermittently, or a corroded earth strap, will produce stalling that appears to have no pattern at all. These are among the harder faults to find and usually need a wiring diagram and patience.
Does the way it dies tell you anything?
A great deal. An engine that stops instantly, exactly as if switched off, suggests an electrical interruption or a lost crank signal. An engine that stumbles, hesitates, loses power and then dies is running out of fuel or air. An engine that dies only when decelerating or braking points at idle control or a brake servo leak. Noting which of these happens, and whether any warning lights appeared before or after, is the most useful thing you can do.
Why do the fault codes often show nothing?
Because many stalling faults are momentary and the management may not log them, or may log a generic code that names a symptom rather than a cause. This is why freeze frame data matters, since it captures engine speed, load and temperature at the moment a fault was recorded. Asking specifically for stored and pending codes plus freeze frame data, rather than a simple code read, gets far more out of the same visit.
What should you do in the meantime?
Treat it as urgent. Avoid motorways, fast roads and long journeys until it has been diagnosed. If it stalls, coast to the side using the momentum you have, remembering the steering will be heavy and the brakes will need considerably more pressure, and put the hazard lights on. Note the conditions each time, because a pattern involving heat, bumps, braking or duration is what will eventually identify the cause, and an intermittent fault is nearly always solved by the pattern rather than by the test.