How does an engine turn off?

When you turn off the engine, what exactly is cut off to make the engine stop running? Is it power to the ECU? Is it power to the fuel pump?

cuts the power to plugs, fuel pump, ecu. once the switch is off there is no power to anything,
but i’d say the first thing would be the ignition(sp?) ex. coil, distrubton, plugs