In a completely sealed enclosure, thermal differences between the inside and outside will result in a pressure difference because warm air is less dense than cold air. Therefore when there is an opening air will flow across the Roof terminals boundary to equalise the pressure.
During the heating season the warmer indoor air rises up through the building and escapes at the top through ventilation openings (or Roof terminals). The rising warm air reduces the pressure in the base of the building, forcing cold air to infiltrate through either open doors, windows, or ventilation openings. During the cooling season, the stack effect is reversed*.

The force of the wind is driven down into the room or space below and, having a greater density than the internal air, this cooler incoming air flows down to floor level, whilst the less dense, warmer internal air rises and exits through the passive or active stack quadrants as a form of displacement ventilation.