When a plane is coming into an airport and it’s lost its ability to drop or lower its landing gear, emergency teams will foam the runway so that the plane lands and skids into a big pile of foam. That way, if any fires erupt, it’s already pre-foamed and maybe keeps the fire hazard down. So when you’re expecting something bad to happen, you foam the runway.