This is called “venting the roof.” There are two basic reasons for this practice. Dangerous gases and dark smoke accumulate in a burning building. Unlike the movie version of fires, it is impossible for firefighters to see in such an environment.
When a hole is made in the roof because the building is “vented,” the smoke and gases escape because heat and smoke rise. It makes it much easier for the firefighters in the building to see. It also reduces the possibilities of backdraft and flashover. Another reason for venting the roof is to see how far the fire has progressed.
One of the fastest avenues through which fires spread is the attic. Heat and smoke rise into the attic where the fire can move quickly. Firefighters may go ahead of the fire on a roof, cut holes to access the attic, and stop the fire from spreading through the attic.