12v is only connected through the fuse to the valve when the ignition is off. The oil pressure switch only connects a ground to the other side of the valve when the engine is running and generating oil pressure. So with a running engine
the valve only operates when the ignition is switched off. When the engine stops and the oil pressure dies away the valve releases again.