This simple question has been bugging me for a while. The amount of fuel injected into a petrol engine is calculated according to the amount of air entering through the throttle valve (as measured by the mass airflow/manifold absolute pressure sensor). However the amount of fuel injected into a diesel engine simply depends on the pedal press and the air is able to be sucked into the cylinders freely. That means in normal operation diesel runs really lean and petrol is constantly maintaining the stoichiometric ratio (high load situations not considered). Why can't the petrol engine run lean without the throttle valve as well, just depending on the amount of fuel injected?
It sounds like you already know why a gasoline engine keeps the fuel/air ratio as close to the stoichiometric ratio as possible, but just for the sake of information for anyone else: The stoichiometric fuel/air ratio is the amount of oxygen required to burn all of the gasoline completely. A "lean" burn leaves some oxygen leftover and a "rich" burn means the gasoline does not burn as completely.
Diesels run lean because, according to this website:
In the diesel engine, the fuel is injected into the combustion chamber near the end of the compression stroke and ignites spontaneously. This is responsible for the combustion sound that a diesel engine generates that is music to the ears of everyone who reads this magazine. As mixing between the fuel and air occurs, burning continues. This process is very heterogeneous (since the fuel and air are mixed in a combustion chamber it is not as uniform as in a gas engine that has the mixture created prior to entering the cylinder head). Soot is formed during combustion because some of the fuel burns with insufficient oxygen, and the combustion of the fuel is not completed. As additional fuel is injected, more and more soot is produced. Therefore, the air/fuel ratio of the diesel engine must always be leaner than stoichiometric to prevent excessive amounts of smoke. For this reason, a modified, high-output diesel will blow black smoke because it is fueled for power alone with no concern for soot generation. The smoke-free diesel has less fuel present in the cylinder than in the cylinder of the gasoline engine, and diesel power is therefore reduced in comparison.
Gasoline is injected before it is ignited, so it has time to mix more homogeneously. Diesel is injected towards the end of the compression stroke, so it combusts under the pressure almost immediately before it has time to spread throughout the available air. As the above quote states, running the diesel engine lean is an attempt to reduce the amount of soot produced, which reduces emissions.
To address your question of what happens to a gasoline engine that burns lean.
Injecting gasoline into the engine has a cooling effect. A lean-burning engine, where there is less gasoline than necessary to achieve the stoichiometric ratio, will run hotter than an engine running at the stoichiometric ratio or one running rich. Run too lean and you risk overheating and extra wear and tear on engine components such as seals. At higher compression ratios, lean engines can be more fuel efficient and produce less carbon emissions. The downside is that there are more NOx emissions that require a more complex catalytic converter than most modern vehicles have.
I should also clear up your final sentence. Your accelerator is connected to the throttle valve (either directly or "drive by wire") and controls how much air is allowed to pass into the engine. It does not directly control how much gasoline is injected. The mass flow sensor detects how much air is being passed into the engine, passes that information to the ECU, and the ECU controls how much fuel is injected. Whether your car is running lean or rich is decided by the ECU through inputs from the mass flow sensor, O2 sensor, and/or manufacturer or user settings. In the days of carburetor, it was easy to tune the engine to run rich or lean, but you need special equipment to adjust the settings in an ECU.
By the way, there are various reasons a manufacturer or vehicle owner might want to run their engine lean or rich having to do with performance, cooling, or fuel economy.
I am highly surprised that no one mentioned it specifically, but the answer is detonation. Poisson Fish was close, but extra wear from increased cylinder temperature isn't the main problem. The main problem is the extra heat causing petrol to self-ignite before the spark and destroy the motor.
Diesel doesn't suffer from this problem as it basically works on this principle - diesel ignites as soon as it enters the cylinder.
My guess is if petrol had a much higher octane rating then technically we could run it like a diesel.
If you mixed diesel with air before it entered the cilinder and then compressed it in a normal ( Diesel engine ) compression stroke it would certainly detonate before you reached top dead centre. However in normal operation, diesel is sprayed into the cylinder and burns as it exits the injector and comes into contact with the heated air. Only the diesel entering the combustion chamber ignites. As there is no other fuel present there is nothing there to detonate. Spark ignition engines have all the fuel and air present in the combustion chamber ready and waiting for the spark to start ignition. Then a flame front moves outward from the spark plug. If the pressure is too high or the temperature too high or there is a hot spot in the cilinder the entire fuel air mixture can detonate at once. As a side note:- Diesel actually can be used in a spark ignition engine. We once had a tractor with a small petrol tank and large diesel or kerosene tank. You started on petrol, switched to diesel when the engine had warmed up, and switched back to petrol before shut down, to ensure there was petrol in the carburettor ready for the next start up. It was impossible to start cold on diesel, and did not run well on petrol when hot. I believe the compression ratio was higher than normal petrol but less than normal diesel, and the petrol would cause detonation when the temps got high before you switched to diesel.
The other answers failed to note that the air-fuel ratio is dependent on the position you measure it at. So, even though the air-fuel ratio averaged over the whole cylinder is lean (so lean that combustion wouldn't be possible if the mixture was homogeneous), very close to the injection point it is extremely rich (so rich that combustion isn't possible), and bit further from the injection point it is stoichiometric, and thus the fuel burns.
Actually, a petrol engine does not need to maintain stoichiometric air-fuel ratio. There are direct injection petrol engines like there are diesels. A direct injection petrol engine similarly has very close to the injection point rich air-fuel ratio, but a bit further away it is stoichiometric and thus the fuel burns, even though globally the air-fuel ratio can be lean.
However, the problem of lean air-fuel ratio is that there is too much oxygen, making it possible for the nitrogen in the air to burn to various oxides of nitrogen. The NOx produced is a pollutant, and in the future will prevent all engines using lean air-fuel ratio to comply with the regulations, unless some kind of SCR system is used. So, unless you like adding SCR fluid manually, the only option in the future will be a stoichiometric engine.
Because in a spark ignition engine restricting airflow is the only way to control the engine RPM. It would be difficult to control the RPM of the engine by varying the fuel alone without restricting airflow. This is because in spark ignition engines the ignition begins where the spark plug is located and travels away from that point. Whereas in compression ignition engines the ignition begins wherever the fuel is located once injected. Also direct injection compression ignition engines are not homogeneous mixture because the fuel is not allowed enough time to mix in the combustion chamber prior to ignition. You can see this on a YouTube video of a camera inside a diesel engine. In the video you can literally see trails of fuel igniting as they spray from the injector nozzle. Also when I was a kid I had an old lawn mower and I used to play around with the mixture adjustment screw and by making the engine run leaner I could achieve higher RPMs without actually moving the throttle plate. I don't truly understand why a leaner fuel mixture produces a higher temperature but it could be because since there is a greater distance between the droplets of fuel as there is less of them each droplet could be given more time to burn and therefore generating more heat but I'm not sure that's just a theory.
Petrol engines are run as closely as possible to the stoichometric ratio because in that band, the catalytic converter is at its most efficient.
A fuel-rich mixture is avoided because this can damage the converter.
Diesel engine does not use throttle plate for air control, throttle plate is always open.
This means that diesel engine always draws in the maximum amount air, and power is regulated by the amount of fuel supplied. With petrol engine throttle plate controls the amount of air coming into the engine, this quantity will vary depending on the load and thus the need for air-fuel ratio control.
Hope that helps.