As I recall (I have the BEV version, without REX) it's quite a complicated system. The petrol tank is pressurised all of the time other than when it is being filled, and the system has to depressurise before you can open the cap.
If the system detects that the tank is losing pressure, it will...