The code tweaked the engines to pass the EPA's certification tests – passage of which serves as a kind of permission slip to sell cars – by making them produce hair-splitting differences less oxides of nitrogen (NOx) while being tested, to get them through increasingly unreasonable regulatory rigmarole designed to prevent them from being sold. Because diesels – efficient, practical and inexpensive – pose a threat to the expensive, inefficient and impractical electric car agenda, which is really an anti-driving agenda.
But that's another rant.
Out in the real world, unplugged from the government's testing rigs, the "cheating" cars produced fractionally more NOx, in the interests of better mileage and drivability.
This "cheating" being harmless; the same thing as using a radar detector to avoid being pinched by a cop for doing 45 in a 40.