How does a gas pump know when to turn itself off?

If you've ever wondered how a gas pump nozzle knows when to shut off when your tank is full, this video reveals the clever design.

Venturi tubes, Bernoulli principles, negative pressure — it turns out the design is far more complicated that you might expect. I always assumed it was some sort of an electronic sensor, but it's purely mechanical.

Image: Screengrab from video, Steve Mould.