Hiya matt,
The cutoff valve is basically just an electromagnet that controls a plunger. In this respect it is much like a solenoid.
When the plunger is extended (car off no juice to the cutoff valve) it blocks the fuel delivery. As soon as the key is turned the magnet pulls the plunger back allowing fuel to flow inside the carb. This is a pretty simplistic explanation but give the idea.
So..................when you turn the key off after a trip, the plunger hits home, cuts off the fuel, and prevents dieseling (which is why the cutoff valve is there in the first place).