When there is an exchange of heat between a hot object and a cold object, the temperature of the hot object falls and the temperature of the cold object rises. If this system of two objects is isolated from the surroundings so that no heat enters or leaves the system, then, heat lost by the hot object = heat gained by the cold object. After some time, the average kinetic energies of the atoms in the two objects become equal, i.e., the two objects attain the same temperature.