A number of engines, including GM ones, use an idle stop solenoid or high idle solenoid. It closed the throttle further than normal idle speed when the key was turned off to prevent dieseling.
Fuel injection solved the problem for good- - - - -no fuel to support dieseling once the ignition switch was shut off.
Jerry