Gasoline engines are not subtle machines. They take in air and an already volatile fuel (gasoline) to form a vaporous mixture, which is then compressed and lit with a spark.
The resulting explosion is violent. It pushes outward with great force, pushing a piston, which in turn rotates a shaft, which together with the other cylinders in an engine produce the power needed to move the car.
Conventional four-stroke gasoline engines have thousands of these explosions per minute. And making that possible are valves that open to let air (and sometimes fuel), close while the mixture is being compressed and the spark plug fires, then open to let exhaust out. Carburetors used to be the devices that crudely mixed fuel into the intake air. Then fuel injection and electronic fuel injection found more precise means; and now with direct fuel injection relatively common, the fuel is sprayed even more precisely, directly into the combustion chamber.
Meanwhile, gasoline is a highly flammable mix of hydrocarbons, and derived from crude oil—with, in typical pump gasoline, various detergents, additives, stabilizers, and yes, even corn ethanol in many cases. There are plenty of emissions by-products—like carbon monoxide, nitrogen oxides, unburned hydrocarbons, sulfur dioxide—and equipment like catalytic converters has been added to cars to attempt to make these emissions less harmful.
In the quest for better efficiency, improved reliability, and smoother operation (with fewer emissions, too), gasoline engines have been given electronically controlled ignition, as well as complex valve controls that open the valves at slightly different durations and physical degrees, depending on the need.
In all, through timing, smart spray patterns, and electronic monitoring and fine-tuning, these valvetrain and fuel systems finesse some of the detonation (the violence) of the combustion, which helps in turn get more our of the fuel, and less noise and wear from the engine.