Why does the fire department punch a hole in the roof of a house when it is on fire?

When there is a fire in a closed structure, the fire and smoke build up and move upward until it cannot go up any farther. Smoke travels upward until something stops it like a ceiling or a roof. At this time, the smoke mushrooms outward filling the structure. If the firefighters punch a hole in the roof, the smoke is able to escape. If there are victims inside, this could better enable them to breathe and be more easily located by the firefighters. If the firefighters ventilate the structure, the heat will dissipate and the firefighters can more easily locate the fire and extinguish it.