In the late 19th Century the most suitable fuels for the automobile were coal tar distillates and the lighter fractions from the distillation of crude oil. During the early 20th Century the oil companies were producing gasoline as a simple distillate from petroleum, but the automotive engines were rapidly being improved and required a more suitable fuel.
During the 1910s, laws prohibited the storage of gasolines on residential properties, so Charles F. Kettering modified an IC engine to run on kerosine. However the kerosine-fuelled engine would "knock" and crack the cylinder head and pistons. He assigned Thomas Midgley Jr. to confirm that the cause was from the kerosine droplets vaporizing on combustion as they presumed.
Midgley demonstrated that the knock was caused by a rapid rise in pressure after ignition, not during pre ignition as believed. This then lead to the long search for antiknock agents, culminating in tetra ethyl lead.
Typical mid-1920s gasolines were 40 - 60 Octane. Because sulfur in gasoline inhibited the octane-enhancing effect of the alkyl lead, the sulfur content of the thermally cracked refinery streams for gasolines was restricted.
By the 1930s, the petroleum industry had determined that the larger hydrocarbon molecules (kerosine) had major adverse effects on the octane of gasoline, and were developing consistent specifications for desired properties.
By the 1940s catalytic cracking was introduced, and gasoline compositions became fairly consistent between brands during the various seasons.
The 1950s saw the start of the increase of the compression ratio, requiring higher octane fuels. Octane ratings, lead levels, and vapor pressure increased, whereas sulfur content and olefins decreased. Some new refining processes ( such as hydrocracking ), specifically designed to provide hydrocarbons components with good lead response and octane, were introduced. Minor improvements were made to gasoline formulations to improve yields and octane until the 1970s - when unleaded fuels were introduced to protect the exhaust catalysts that were also being introduced for environmental reasons.
From 1970 until 1990 gasolines were slowly changed as lead was phased out, lead levels plummeted, octane’s initially decreased, and then remained 2-5 numbers lower, vapor pressures continued to increase, and sulfur and olefins remained constant, while aromatics increased.
In 1990, the US Clean Air Act started forcing major compositional changes on gasoline, resulting in plummeting vapor pressure and increasing oxygenate levels. These changes will continue into the 21st Century, because gasoline use in SI engines is a major pollution source.
The move to unleaded fuels continues worldwide, however several countries have increased the aromatics content ( up to 50% ) to replace the alkyl lead octane enhancers. These highly aromatic gasolines can result in damage to elastomers and increased levels of toxic aromatic emissions if used without exhaust catalysts.
Here is a working animation of a 4 cycle gasoline engine: