The Second Law of Thermodynamics. At the time heat was thought to behave like a liquid. Water, and heat, never spontaneously flow 'up hill', that is, from 'lower levels' to 'higher levels'.
Heat never moves from a cold object and into a hot object.
Things always cool down. Water at the top of a 100 meter hill can flow a maximum of 100 meters down that hill until it reaches sea level and can flow no further. But, if the water only flows 60 meters down the hill before it is trapped in a lake, then it will only be able to do the equivalent of 60 meters worth of work. The two laws of thermodynamics, taken together, give us two limits to the use of energy. While the second law says that you cannot even get at all the energy in a system, only the available energy.