It is incredible that anyone at Volkswagen thought the company could get away with it. Did the engineers and executives who came up with that bit of cheating software ever consider the enormous risk they were taking? Did they really think it was worth the inestimable damage to their customers, to the environment, to their shareholders and to their venerable brand to squeeze a bit of illicit power out of their engines?

Yet that’s exactly what they did, according to an announcement by the Environmental Protection Agency on Friday. VW’s share prices promptly plummeted 19 percent; the company now faces billions in fines, costly recalls, possible class-action lawsuits and criminal charges, investigations into its global practices and tremendous blows to sales, to the VW brand and to Germany’s vaunted auto industry.

Senior executives are rushing to express remorse for installing “defeat devices” in Volkswagens and Audis with 2-liter diesel engines not only in the United States but in an astonishing 11 million cars worldwide. The devices consisted basically of software that lowered emissions to legal standards during emissions testing but let the pollutants spew the rest of the time, increasing performance. The bad stuff includes nitrogen oxides, a primary constituent of health-threatening smog, and microfine particulate matter, which causes respiratory disease. Both are strictly regulated under the Clean Air Act. For something this deceitful and stupid, a corporate mea culpa is not enough. Volkswagen must explain how something like this could happen, and identify those who came up with the idea and authorized it.

Discrepancies between claimed emission levels and those achieved in everyday driving are not, alas, unusual. Last November, the South Korean carmakers Kia and Hyundai paid more than $300 million in fines and penalties for misrepresenting the emissions from their cars. But there is a difference between fudging figures and actually devising and installing clever software on cars solely to deceive inspectors and consumers.

A reason for the cheating was evidently to buttress Volkswagen’s effort to expand sales of diesel-powered cars in the United States, where the oil-burning engines have never had much popularity. Volkswagen’s claim was that its diesels were as clean and powerful as gasoline-powered cars, but with far higher torque and better gas mileage. In Europe, VW’s biggest market, diesels account for more than half of car sales and are promoted because their energy efficiency makes for fewer global-warming gases.

The discovery of VW’s machinations raises many questions. Why was the discrepancy first discovered by private researchers? Is VW unique, or do other manufacturers of diesel cars use similar tricks? VW’s chief executive, Martin Winterkorn, has pledged a thorough internal inquiry and full cooperation with outside investigators. The E.P.A. and the State of California have announced their own investigations; in Europe, Germany, Britain and European Union agencies have indicated they will also be looking into VW’s practices. Given the scope of the damage VW has done and the gravity of the questions it raises, it is imperative to get to the bottom of this matter.