It’s been three years since news about Volkswagen’s emissions-cheating diesels broke. While everyone knows that VW installed cheat devices in its diesel-powered vehicles, there are a lot of questions as to how they worked. The video below explains how VW’s devices managed to get past the Environmental Protection Agency’s (EPA) testing.

Engineering Explained returns in a new video to, as usual, provide an easy-to-understand look at the defeat device and what it does in the vehicle. Understandably, the device is a lot more complicated than people first assumed – and to comprehend how it works, you’ll need to have some basic knowledge down on how a diesel powertrain works.

Luckily, Jason Fenske’s got that part covered with his trusty whiteboard. After explaining the inner workings of a diesel engine, Fenske goes in on VW.

The gist of the cheat device is pretty simple. It can distinguish between the vehicle being run on a dyno, which is how the EPA does its testing, and actually being driven on a road. When it senses that the car is in a real-life situation, the device chooses performance and fuel economy over emissions.

It does this by minimizing exhaust gas recirculation, having the engine run on a leaner air-fuel ratio when possible, and, lastly, it will make the nitrogen oxide trap ineffective by choosing not to use fuel to clear the component out. The device allowed VW to get away with emitting 40 times the legal limit of nitrogen oxide.

For a device that was reported made roughly 20 years ago, it’s highly complex. And it sounds like it would’ve just been easier for VW to find a way to meet emission standards instead of trying to find a way around them, though apparently the latter was cheaper – until the whole thing backfired, of course…

Fenske then takes a look at how VW and some other German automakers came up with the “bright” idea to fumigate monkeys with diesel exhaust fumes in a twisted science experiment. So, if you’ve been struggling to wrap your head around Dieselgate, this is a must-watch video.