A heat engine performs the conversion of heat energy to work by exploiting the temerature gradient between a hot an cold sink. Heat is transferred to the cold sink from the hot sink and in this process some of the heat is converted into work. The most efficient heat engine possible is the carnot engine which has an efficency equal to (T1 - T2)/T1 where T1 is the hot sink and T2 is the cold sink.
Examples of heat engines are: the steam engine,the diesel engine, the gas engine in your car, and an imaginary one called the Carnot heat engine. (A refrigerator is effectively a heat engine run in reverse: see separate treatment in that article.)
From the laws of thermodynamics, we can conclude that:
H = C - W
where H is the energy exchanged with the high temperature system, C is the energy exchanged with the cold system, and W is the work done by the engine.
The efficiency of a heat engine is defined by:
e = W / H = (C / H) - 1
The efficiency of any real engine can not be 1. In fact, the most efficient a heat engine operating between two temperatures (Th [h for hot] and Tc [c for cold]) can possibly be is determined by how efficiently a Carnot Engine would work; given by:
ecarnot = 1 - Tc / Th
The reasoning behind this relates to the laws of thermodynamics and the fact that if one were to hook a Carnot engine (also works in reverse to force heat from cold to hot) to a more efficient engine, one could theoretically make entropy go backwards.
See also: