Gases possess poor thermal conduction properties compared to liquids and solids, and thus makes a good insulation material if they can be trapped.
The air-trapping property is also the insulation principle employed by homeothermic animals to stay warm, for example down feathers, and insulating hair such as natural sheep's wool.