The PCM (Powertrain Control Module) controls various sensors, switches, and other electrical components of the vehicle in order to make the vehicle operate as efficiently as possible. In the case of the Oil Pressure Sensor, it detects the amount of mechanical oil pressure in the engine. It then transmits this information in a voltage reading to the PCM. This value is then transmitted to a gauge located in the instrument cluster, which allows the driver to be aware of the oil pressure.
When the DTC P0524 OBDII code is set, it is because the PCM observed an excessive value from the Engine Oil Pressure Sensor. Note that such a condition is extremely dangerous to the engine, so you should stop and shut down the engine as soon as possible.