When air is heated, it becomes less dense, while when it is cooled, it becomes denser. This can affect the concentration of various gases, including oxygen.