⟩ Why does heated air expand?
Temperature is often defined as the average thermal energy of the substance at hand. Thus the hotter a substance is the more thermal energy it has. For most substances the statistical mechanics formula, (3/2) kT works fine. In the preceding formula, k is the Boltzmann constant and T is the absolute temperature.
As thermal energy increases, the molecules of a substance move faster. These molecules hit other molecules faster and harder and bounce away from collisions faster and harder. Without a container to limit its shape, a gas will simply expand. Were a container present, the pressure of the gas in the container would increase.