Students apply enough pressure to "explode" a straw.
When you twist the straw, the same amount of air is being pushed into a smaller and smaller space. This increases the air pressure inside the straw.
The straw isn't strong enough to withstand extra pressure caused by a fingernail flick against the pressurized area. The straw cracks and the air rushes out, flowing from an area of high-pressure to an area of low-pressure.
The sudden release of high pressure in the straw causes the loud pop due to the rush of air. This is the same effect as when a balloon pops.