An engine oil pressure switch is used to maintain power to the engine, and the vehicle, once the engine has started. When the engine is cranking, power is being supplied through the starter circuits. However, once the engine is running, and the oil pressure is up, power is routed through the oil pressure switch and sensor unit. This is done to ensure the engine is not run without oil. If the sensor does not read the right pressure, the switch will not close, and the vehicle will not stay running.
For more info, see How to Use an Oil Pressure Sensor