The purpose of a gasoline car engine is to convert gasoline into motion so that your car will move. Currently the easiest way to create motion from gasoline is to burn the gasoline inside a car engine.
A gasoline car engine is an internal combustion engine -- combustion takes place internally, inside of the gasoline engine.
The principle behind any reciprocating internal combustion engine: If you put a tiny amount of high-energy fuel (like for instance gasoline) in a small, enclosed space and ignite it,
an incredible amount of energy is released in the form of expanding gas.
Almost all cars currently use what is called a four-stroke combustion cycle to convert gasoline into motion. The four-stroke approach is also known as the Otto cycle,
in honor of Nikolaus Otto, who invented it in 1867. The four-strokes are: