please can you explain under what circumstances they are legal when they are not?
My possibly erroneous understand is that you must have the pedals rotating even if “ghost” pedalling, and you cannot travel even at legal speeds via a throttle with the pedals not rotating.
Any throttle is legal. All it is is a sensor that gives an input to the controller, the same as any pedal sensor does. There is no rule or law prohibiting them. The laws relate to the way the controller works, nothing to do with the throttle. It's not allowed to give power to the motor unless the pedals are turning except when the speed is below 6km/hr. You can use any device you want as a sensor to regulate the speed.
The misunderstanding comes from people not understanding what a throttle is. It's called a throttle because it restricts the flow of air going into an IC engine, so can be used as a speed or power regulator. There is no such thing for an ebike because there is no airflow to power the motor. What we call an ebike throttle should be called a speed controller because they don't throttle anything.
Many ebikes have a hall sensor to show when the pedals are turning. When a magnet comes to a hall sensor, it changes the amount of electricity that goes through it, so a series of rotating magnets give a pulsing signal, which the controller interprets as pedalling.
Ebike "throttles" have a single hall sensor and two magnets. By twisting the grip, the magnets change the amount of electricity that goes through it, so the controller can read that as a signal, then, according to its programming, decide what to do.
The controller is a microcoprocessor that has a range of inputs and outputs and a set of instructions.
In summary, if you say a throttle is illegal, you might just as well say that the battery is illegal or the motor is illegal because they have more effect on the bike moving than a sensor. Any bike can be made to go without pedalling and without even having a "throttle" if you program the controller that way. Did you know that even the Bosch system can make the bike go fast without pedalling if you have the right password?