To defeat Ahiravan, Lord Hanuman had to, all at once, extinguish the 5 lamps in which Ahiravan’s life force was. So Lord Hanuman took on the Panchmukhi avatar, and blew on the 5 lamps all at once, thereby defeating Ahiravan.