Engines - whether driven by steam or internal combustion, make use of the properties of gases. These were well-known by the time steam power was coming into widespread use at the end of the eighteenth century.
The first of the gas laws to be discovered was Boyle's Law, published in 1662, which states that for a given mass of gas at a constant temperature, the volume is inversely proportionate to its pressure.
The second was Charles' Law, or the law of volumes, discovered in 1787 by Jacques
Charles. It states that, for a given mass of an ideal gas at constant
pressure, the volume is directly proportional to its absolute temperature (minus 273 degrees Centigrade), assuming the system is closed - ie that nothing can get in or out of the containing vessel.
The third gas law was Gay-Lussac's Law, the Pressure Law, discovered
in 1809. It states that, for a given mass of a gas at a constant volume of an
ideal gas, the pressure exerted on the sides of its container is
directly proportional to its absolute temperature.
The term "adiabatic process" is used to describe what happens when the volume of a gas is allowed or forced to change without any heat being added or removed. An example is when the air in a bicycle pump heats up when pumping. The energy from the pumping action heats up the air in the pump. The same effect in reverse is observed when a compressed gas is allowed to expand suddenly, for example, when it is released from a gas cylinder: it cools.
This is the key to understanding what happens when a hot gas under pressure is allowed to expand, for example in the cylinder of an engine. The gas cools, and useful work is done as heat energy is lost, being converted into mechanical energy. The process was analysed by the 28 year old French military engineer Nicolas Carnot. His army career having stagnated, Carnot befriended the scientist Nicolas Clément and attended lectures on physics and chemistry. He became interested in steam engines and what could be done to improve their performance. This led him to the investigations that became his "Reflections on the Motive Power of Fire", (Réflexions sur la Puissance Motrice du Feu) published in 1824, in which he described what became known as the Carnot Cycle. Not only is it one of the core concepts in the theory of engines of all kinds, it is also the basis of the Second Law of Thermodynamics.