Heat transfer and thermal equilibrium

Energy flows as heat from the hotter body to the colder by collisions of their particles until they reach the same temperature, and the energy one loses is the energy the other gains.

From AP Chemistry.