There's a wonderful stack exchange article that explains this in detail, but I'll also sum it up right here.

https://aviation.stackexchange.com/questions/1609/why-do-jet-engines-get-better-fuel-efficiency-at-high-altitudesThrust is the difference between the entry impulse of the air entering the engine and then the exit impulse of the heated fuel and air mixture leaving the engine. Impulse is mass times velocity, and expressed with a mass flow ṁ, and thrust T is

T=ṁ⋅(v

_{exit}−v

_{entry})

The exit impulse is increased by accelerating the airflow through the engine, and the acceleration is achieved by heating up the air more.

Every gram of fuel heats up a given mass of air by a certain number of centigrades. The definition of the energy content of fuels is given as the capacity to heat a pound of water by one degree Fahrenheit.

Thermal efficiency is the ratio between the mechanical work that is extracted as thrust in addition to the heat energy spent on heating the air, and it is indirectly affected by the flight altitude.

(see the Wikipedia page on the Carnot cycle

https://en.wikipedia.org/wiki/Carnot_cycle)

This cycle (and also others) describe the workings of combustion engines in thermodynamic terms.

It says that the efficiency of a combustion engine cannot be greater than the temperature ratio between the temperature increase from ambient (t

_{amb}) to the maximum temperature t

_{max} of the process, divided by the maximum temperature. All temperatures must be expressed as a total temperature, where 0° means 0 K or -273.15°C. Engines operating in colder air makes the ratio bigger and will improve efficiency.

Here's another equation:

ηt=t

_{max}−t

_{amb}/tmax

This should sum it up for the most part.

Please correct me if I did anything wrong; I'm no master in aviation.