For the first time the true scale has been revealed of a coldly calculated, deliberate and sustained scheme by scores of Volkswagen executives and engineers to defraud American car buyers and deceive American regulators.

The biggest scandal in the 130-year history of the auto industry has been laid bare in a five-count civil complaint against VW announced by New York State Attorney General Eric Schneiderman and Massachusetts Attorney General Maura Healey on Tuesday.

It goes far beyond in detail what was revealed when the company last month agreed to pay $15.3 billion to settle consumer and regulator lawsuits, alleging a company-wide conspiracy to ignore the consequences of seriously polluting the atmosphere, to lie to regulators, spend millions on patently false advertising and to desperately persist in a cover-up.

The complaint throws a devastating light on a company culture that from the top down remained committed for years to cheating on U.S. emissions tests for not just VW models but also Audi and Porsche models using diesel engines—to the extent that the engines on some models emitted up to 40 times the permitted levels of nitrogen oxide pollution.

Executives even carefully evaluated what the cost would be to the company if they were caught. Reviewing previous cases of violations of environmental regulations by auto manufacturers in the U.S. they predicted that the likely fines posed “only a moderate cost risk.” They cited the highest fine, imposed against Hyundai/Kia as amounting to “barely $91 per vehicle” and added “fines in this amount are not even remotely capable of influencing the share price of a globally operative company such as Volkswagen.”

Portraying what it calls “a cynical fraud on the American car-buying public,” the lawsuit claims that once VW realized, last summer, that regulators in California were about to expose the scandal, the automaker’s staff deleted or removed incriminating data from the company’s records.

The company also embarked on a multi-million-dollar advertising campaign in the U.S. designed to sell diesel as a “green and clean” form of power (complete with ads using towels and coffee filters to show how pure the exhaust was) when they knew that it was anything but.

“Defendants sold vehicles that, based on initial estimates, have illegally emitted over 45,000 additional tons of NOx emissions in the United States,” the lawsuit said, “often into economically disadvantaged communities adjoining highways whose residents are prone to asthma and other respiratory diseases that NOx emissions exacerbate.”

The basic trick used by VW to cheat is already well known. Put simply, the software in the German cars could detect when the car was in the shop for an emissions test—or in a regulator’s lab. On sensing this the computers adjusted the exhaust settings so that the emissions fell within the permitted range. Once the car returned to the road the engine reverted to its dirty normal. This is known as a defeat device.

In the course of 10 years, VW produced six generations of defeat devices. Writing the software, VW engineers spotted that one sure indication that a car was being tested on a dynamometer was if, as it accelerated and decelerated, the steering wheel did not move.

And the New York case provides a whole lot more insight into the lengths VW went to cheat the system. It details six successive versions of defeat devices used across the range of VW, Audi, and Porsche diesels. Moreover, it reveals that VW went a further step to make sure it was not caught. In New York and other states the annual inspections do not actually measure the exhaust emissions. They rely on the car’s onboard diagnostics (OBD) to detect whether the car is running clean.

“To allow its defeat device equipped vehicles to pass New York’s inspection and maintenance tests,” says the lawsuit, “Volkswagen therefore needed to, and in fact did, implement a further cheat: It programmed the OBD systems to falsely report at inspection time that the automobile emissions systems were working properly.”

In part this astonishing narrative is the story of how a mighty corporation was brought down by a handful of dedicated investigators. The fake performance of the diesel engines was finally exposed by a team of engineers from West Virginia University. On drives between Los Angeles and Seattle they discovered that a VW diesel sedan’s emissions exceeded by as much as 35 times the permitted amount of nitrogen oxide.

Following this revelation, according to the attorneys general, VW executives launched a 17-month campaign “to mislead and confuse regulators and the public about the true cause of the high real-driving NOx emissions.”

In this their main adversary appeared in the defiant form of the California Air Reserves Board, or CARB, an environmental watchdog set up by then-Gov. Ronald Reagan in 1967.

VW executives were feeling the heat because they had a great deal at stake: the U.S. launch of new VW sedans for the 2016 model year, all of them being shipped with the sixth generation defeat devices.

In an October 2014 teleconference with the CARB, VW fielded a team of managers who “cited phony technical explanations for the high emissions, omitted any mention of the true cause of the high NOx emissions and assured regulators it could ‘optimize’ the vehicles’ emissions performance by conducted software recalls.”

One of the engineers cited in the complaint, James Liang, had been directly involved in developing the first defeat device in 2006. In 2014 he was sent to California to devise tests intended to bamboozle the CARB and also VW dealers into believing that everything could be fixed by a recall to update software.

By mid-July 2015 the new models were piling up in the docks awaiting clearance from the CARB that they met emissions standards. But the CARB demanded more information and, not getting it, got hold of a 2016 model and tested it. At that point VW knew that the campaign of obfuscation was not working and that their great fraud was finally about to be exposed.

At a meeting with the CARB on Sept. 3 six VW executives admitted to the illegal defeat devices, although it was not until Sept. 18, with an announcement from the Environmental Protection Agency that it was taking action, that the scandal became public and reverberated around the world.

The most senior VW officer listed in the indictment is Martin Winterkorn, who was CEO of Audi from 2002 to 2007, when the original defeat device was developed, and CEO of VW from 2007 until resigning on Sept. 23, 2015. The day before he resigned, Winterkorn made a video statement that referred to “irregularities” in the diesel engines and said the company would act with “the greatest possible openness and transparency.”

A few weeks earlier, according to the complaint, a senior VW attorney advised multiple employees that a litigation hold was about to be issued, making it impossible to destroy or delete documents. A team of at least eight employees, all in the departments involved in designing the defeat devices, then deleted or removed data from the company records.

“Some, but not all, of the data has been recovered,” the lawsuit said.

At the same time VW’s Management Board, the nine men who had presided over the perpetration of fraud, the cover-up and then a public relations debacle that followed its exposure, were awarded $70 million in executive compensation for 2015 alone.

While the true scale of the scandal and the complicity of company executives in the deliberate deception is now becoming a lot clearer, scant attention has so far been paid to the pressures that could have caused them to take such desperate steps in the first place.

Just how VW’s corporate culture was corrupted, as alleged in the complaint, has a lot to do with the company’s consistent failure to become a major player in the North American market, and the uniquely German mindset that they displayed over the many decades of that failure.

For example, a very telling clue to this mindset could be seen in 2001 at the North American International Auto Show in Detroit. One vehicle drew crowds by the thousands. It was a re-imagining of that Woodstock-era dreamboat, the Volkswagen Microbus.

VW presented the new version as a concept car. It brilliantly fused nostalgia for the original, that little bus with the cute rounded edges and panoramic windows, with 21st century technology and interior luxury.

Auto journalists raved. Pictures of the new Microbus appeared on the front pages of scores of newspapers, along with flashback images of the original in the psychedelic colors applied by hippie roadies.

For years VW had been struggling to find a breakout vehicle just like this that would give the brand a new energy in the North American market.

But the reborn Microbus was stillborn. A production model never got the green light from VW management in Wolfsburg, Germany.

Mark Rechtin, the auto editor at Consumer Reports, cited the Microbus episode as symptomatic of VW’s Germany-first thinking.

“People would have gone berserk for this thing,” he said, “but the politics of the organization and the pridefulness of the home headquarters leads to the attitude ‘We are German engineers. We know how to make things that work right, that are logical, that show this is the way a car should be and Americans should understand how great this is.”

The Daily Beast asked Rechtin, with many years of experience of covering the global auto industry, why, of all the world markets, the U.S. has always defeated VW’s best efforts to become a major player.

“This is a brand that has the technology, the design skills, the scale of production and by all rights they should be as successful as any of the major Japanese brands in the U.S. but they just can’t seem to get out of their own way,” Rechtin said.

“You have to break a million to be a player in America, and VW shows no signs of getting close to that. They had planned to double sales to 800,000 units by 2018 but the scandal has put in doubt that they can get anywhere near that.”

To give context to the competitive pressures on VW it is necessary to begin in 2005. Toyota was the most successful foreign manufacturer in the North American passenger car market. And Toyota, once viewed as conservative in its engineering, had produced a revolutionary sedan, the gas-electric-powered hybrid Prius that eco-minded Americans were suddenly warming to.

VW had no experience in hybrids and no inclination to go there. They did, however, have a long history with diesels, and diesels offered the potential of at least matching the high mileage-per-gallon of the Prius. The only problem was that even the newest diesel technology did not offer the hope of meeting tougher new U.S. emissions standards.

The New York lawsuit reveals internal VW documents under the title of “Volkswagen’s Opportunities with Clean Diesel” and the company’s declared intent to “OWN the segment before the competition comes to market” and to “own Clean Diesel in the way Toyota owns Hybrid.” VW marketing was instructed to use Clean Diesel as an “environmental halo” in its campaigns.

In fact, the revelation of VW’s cheating explained a lot to engineers at Honda and Mazda who had been trying to figure out the secret of VW’s magic sauce. They were so effectively stymied that they decided not to compete with VW because they thought that the German diesels couldn’t be matched.

But, ironically, even the great diesel swindle has done little to help build the VW brand in North America.

“They were basically making one car for the world,” Rechtin told The Daily Beast. “The way they treat overseas markets is very paternalistic. If the overseas markets have any say at all it’s basically in color and trim.”

Looked at with a 60-year perspective VW’s failure to give Americans a mass-produced sedan with, say, the record of Toyota’s perennially dominant Camry is even more astonishing. In the annals of car marketing one campaign remains unequalled for its hutzpah and brilliance in branding: the launch of the original VW Beetle in the 1950s. They never found another campaign or product to match it.

So it’s enlightening to note that the story of Toyota, the foreign brand that bestrides the North American market year on year, did not begin well.

“Their first products were terrible,” Rechtin said. “In the early 1960s they basically walked away from the American market after three years. They went back with their tail between their legs, admitting that they didn’t know what they were doing.

“It took until the late 1960s for them to produce a car that people could respect. They built a beachhead and market share on the West Coast, then moved to the Southwest and up the Eastern Seaboard. By the late 1980s they were building spectacular products.”

And what did Toyota do that the Germans did not?

“Genshi Genbutsu”—a Japanese maxim usually interpreted as “go and see” but, more literally, “actual place, actual thing.”

In other words, Toyota, Honda, and Nissan listened to what the Americans wanted.

“If you’re a chief engineer at Toyota, working on products largely sold in America, you’re going to live in America, you’re not going to make ivory tower pronouncements from Japan,” Rechtin said. “You’re going to drive prototypes for hundreds of thousands of miles on American roads. That’s what they do. It’s real world experience. German chief engineers may get on a plane to America once or twice, but that’s it. For years German cars didn’t have cupholders because in Germany they said ‘You’re driving, what are you doing drinking soda pop?’”

VW persisted in believing that “German engineering” was simply in itself enough to make a brand, employing the slogan “Das Auto” to make it language-explicit, even though they proved incapable of making a diesel engine that would meet emission standards.

And, it turns out that, notwithstanding the scandal, German engineering, at least in the hands of VW, is not always that great. Consumer Reports has unique independence and authority when it comes to testing new cars—they buy as many as 70 cars a year as regular customers from dealers, not taking special test cars with company plates, and 740,000 readers give annual follow-up reviews on reliability and satisfaction.

And reliability has been a persistent problem with VW models in the U.S.

“They make fun vehicles to drive,” Rechtin said, “and they always do well in the way they handle in the road tests but the reliability just isn’t there, especially when the car is new to the market. For all the raves that the new Golf has received its reliability is below average and so therefore we cannot recommend it.”

There is another puzzle. When it comes to quality and reliability, auto analysts and reviewers have often drawn a comparison between the corporate pairings of VW and its upscale sibling Audi and Toyota and its upscale brand Lexus.

The difference is striking. Consumer Reports combines the results of road tests with predicted reliability and owner satisfaction to score the relative performance of brands.

“Lexus and Toyota were within shouting distance of each other, well above the industry average, but while Audi topped the rankings VW finished a distant 15th,” Rechtin said.

In the end, what’s really damning is not just the “we don’t need to listen to you, America, you need to listen to us” arrogance of VW’s managers but how long they have persisted in this belief.

There’s really not much of a mystery in why Toyota went from zero sales to selling two and a half million vehicles a year in the U.S. in little more than four decades.

Genshi Genbutsu—they came, they listened, they conquered. And they didn’t cheat.