Why engine off when key switch turned off?

what is the reason behind while we turned key switch off engine is also shut off give me to answers for if it is an petrol or diesel engine,2-wheeler or 4 wheeler or it is big heavy machine engines.every body will told that it will dis engage the spark plug connection,or shut off solenoid turned on.if this will... show more what is the reason behind while we turned key switch off engine is also shut off give me to answers for if it is an petrol or diesel engine,2-wheeler or 4 wheeler or it is big heavy machine engines.every body will told that it will dis engage the spark plug connection,or shut off solenoid turned on.if this will occur the engine must have to air lock due to lack of diesel.
4 answers 4