An engine in which fuel burns inside the working chamber, pushing a piston or turning a rotor directly. It displaced the steam engine because it is smaller, lighter and starts quickly, and it powered the twentieth century.
In a steam engine the fuel burns outside, heating water in a separate boiler, and the steam does the work. That requires a boiler, a furnace, a condenser and time to raise steam.
In an internal combustion engine the fuel burns in the cylinder itself and the expanding gas pushes the piston directly. Removing the intermediate working fluid removes the boiler and most of the mass, and the engine can start in seconds.

That difference in power-to-weight ratio is why road vehicles and aircraft became possible. A steam car is workable; a steam aeroplane is not.

The dominant arrangement was described by Nicolaus Otto in 1876 and is named after him.
On the intake stroke the piston descends and draws in air, with fuel either mixed in or injected. On the compression stroke it rises, compressing the mixture, which raises its temperature and makes the subsequent burn far more effective. Near the top the mixture is ignited, and the expanding gas drives the piston down on the power stroke, which is the only stroke that produces work. The piston then rises again to expel the exhaust.
Compression is the step that determines efficiency, and the reason is thermodynamic: a higher compression ratio means a larger temperature difference across the cycle, and efficiency depends on that difference, as the Carnot cycle capsule sets out.
Two-stroke engines complete the cycle in one revolution by combining functions, which makes them simpler and lighter but less clean, and they have been largely displaced in road use by emissions rules.
Petrol engines mix fuel and air, compress the mixture moderately, and ignite it with a spark. Compression is limited because too much causes the mixture to ignite spontaneously and unevenly, which is knocking, and octane rating measures resistance to it.
Diesel engines, patented by Rudolf Diesel in 1892, compress air alone to a much higher ratio, which makes it hot enough to ignite fuel injected at the top of the stroke. No spark is needed. The higher compression gives greater efficiency and more torque at low speed, which is why heavy vehicles, ships, locomotives and generators use diesel.
Diesel's disadvantage is emissions. Higher combustion temperatures produce more nitrogen oxides, and the combustion produces more particulates, both of which are harmful to health and are the reason diesel has been restricted in cities.
A modern petrol engine converts roughly a quarter to a third of the fuel's chemical energy into work at the crankshaft, and a large diesel can exceed forty per cent.
Most of the rest leaves as heat, in the exhaust and through the cooling system, and this is not primarily a matter of poor engineering. Any heat engine is bounded by the temperature difference it works across, and materials limit how hot the inside of an engine can run.
Further losses come from friction, from pumping air past a partly closed throttle, and from the engine having to be sized for maximum demand while spending most of its life far below it.
Turbochargers recover some exhaust energy to compress incoming air. Hybrid arrangements allow the engine to run near its efficient point while a battery handles the variation.

The engine reorganised settlement and daily life, making suburbs, road freight and personal mobility ordinary, and it mechanised agriculture through the tractor.
Its costs are equally large. Road transport is a major source of carbon dioxide, and combustion in engines is a principal source of urban nitrogen oxides and particulates. Tetraethyl lead, added from the 1920s to prevent knocking, dispersed lead across the environment for decades before being phased out, and is treated in its own capsules.
Electric drive is now displacing it in road transport, being simpler, more efficient at converting stored energy to motion, and free of tailpipe emissions. The internal combustion engine is likely to persist longest where energy density matters most, in aviation, shipping and heavy off-road machinery.
The internal combustion engine is the machine that made individual mechanical power portable, and almost every feature of twentieth century material life follows from that. It is also a clear case of a technology whose direct benefits and external costs were both very large and were accounted for many decades apart.