Gandalf is the best! He totally set up the major uber firewall for all the demons, they wanted to go and hax the little guys but Gandalf just stepped up and was like "YO DUDE, YOU SHALL NOT HAX!"
Then he took his stick and went WHAM into the ground, making the HUEG firewall that the hueg firemonster couldn't pass!! But why, you ask, would the firewall, being made of fire and wall, stop the even bigger fire monster, being made of fire and monster and capable of destroying wall?
The answer is quite simple: The firewall's kung-fu was stronger than the monster's, making it an easy KO for the wall's part. Also, Gandalf's beard is made of AWESOME and WIN and FRIED HOOKERS.