The reason for this entire behavior is due to the vibration of atoms. If a fast atom is put into a container with all slow moving atoms in it, then the fast one will collide with the slow ones, and its energy will dissipate as the slow ones speed up, and the fast one slows down till all the atoms are moving at the same average speed. This is the same effect as observed when a warm house cools down after the furnace is turned off. So let us examine the nature of heat in some detail, and we will examine the 2nd law of thermodynamics next lecture. First, we need some definitions.
Heat is a form of kinetic energy related to the vibration of atoms.
It flows from warmer objects to cooler ones. It is a measure of the quantity of energy stored in the vibrations of the atoms. This is not the same as heat though it may seem so at first. The temperature of an object is related to how vigorously the atoms in the object are vibrating. Two objects are at the same temperature if no heat energy flows between them when they are in contact.