You are forgetting resistor "ROVS2".
When input is 40V, then the emitter of the MMBT3906 is at 39V6.
It's base is still 600mV lower, at 38V8.
The zener eats up 18V, so the current through ROVS2 is:
(38.8 - 18)/ 27400 = 0.0007591240875912408
This opens the transistor, and shorts the Gate and Source of the P-FET.
Result is that everything after the P-FET is turned off during an overvoltage event.
The maximum voltage levels it can block are mostly determined by the P-FET, and the BAV99 diodes.
This is the normal way automotive overvoltage protection work.
Because the voltages and power levels are so high, you can not simply shunt excess energy to GND, as that would blow up most protection devices.