An engine is some machine that converts energy from a fuel to some mechanical energy, creating motion in the process. Engines - such as the ones used to run vehicles - can run on a variety of different fuels, most notably gasoline and diesel in the case of cars. However, there do exist some alternative fuel types such as biofuels and natural gas. In thermodynamic terms, engines are generally referred to as heat engines, which produce macrosopic motion from heat. The heat in this case comes from the combustion of fuel in the engine, which moves pistons.
Engines used in vehicles, known as internal combustion engines, are some of the most common types of engine as they are used in vehicles, boats, ships, airplanes, and trains. In these engines, fuel is ignited and work is done inside the engine, with the expanding gases moving pistons in the engine.
In terms of how macroscopic motion is created from energy in these engines, there are two main types of internal combustion engines used. The most common type is the reciprocating engine, which uses the up-and-down motion of pistons to convert pressure from expanding gasses into rotational motion. As well as the internal combustion engine, steam engines and Stirling engines are types of reciprocating engines. The other main type of engine is a rotary engine. This type of engine uses a rotating triangular rotor instead of pistons to convert heat from the combustion of an air/fuel mixture into useful work.
Additionally, internal combustion engines in vehicles are designed to run on two main types of fuels. The different engines are gasoline and diesel engines. In a gasoline engine, an air/fuel mixture in the engine is ignited with the assistance of a spark from a spark plug. This then causes the gas to heat and expand, moving pistons. A diesel engine runs in a slightly different manner, igniting the air/fuel mixture through compression instead of using a spark.
This type of engine differs from an internal combustion heat engine in that the heat source they use is separate from the fluid that does the work. In an internal combustion engine, the heat source is the same as the fluid that does the work. The external combustion engine is used in many power plant designs. Some examples of these engines are CANDU reactors, coal-fired power plants, natural gas power plants, solar thermal power plants, and steam locomotives.