According to someone who is a U.S. auto industry expert (and shall not be named here), it is alleged
that VW used an engine control system to determine if the engine was bring tested, and, if so, started a special program designed to make the engine emissions-compliant. Then, after the testing, the program would return to the 'usual' settings.
So, an engine destined for the U.S. market engine would test 'clean', but would revert to a higher-mileage (and less 'clean' setting) when not being tested.
Given that it's a software issue, it's possible that VW used different programs for different types of testing in various jurisdictions.
Tom