Where can one find these "defeat devices"? (asking for educational purposes)
IIRC it was just the firmware in Bosch ECUs.
The ECUs, the computer controlling the engine was programmed in a way in which it could detect the conditions of a test being run and alter it's behavior.