Insulation in the roof works by trapping air in small pockets. The air acts as a barrier to keep heat from escaping in the winter and keeps the building cooler in the summer.