Fire is powerful magic; it used around the world for practical purposes but is so wild and beautiful, and has such great significance for humankind, that it’s practical purpose is often heavily interwoven with magical symbolism.
In paganism, bonfires are lit at various ceremonies and celebrations throughout the year. A bonfire usually represents the sun. At Midwinter or Yule, the fire is lit to celebrate the rebirth of the sun, for even as the days are at their darkest so we recognize the turning towards the light. Likewise, as Midsummer or Litha, the fire is lit to honor the sun at the height of its power, whilst acknowledging that the days must now get shorter. Fires are lit at Beltane for couples to jump in celebration of all things passionate, and at the various harvest festivals to return to the earth that which is not needed - bones, stalks, dead leaves.
Fire is a great cleanser, stripping away the old and preparing the way for new. It also represents the balance of life - for it both protects us and provides methods of preparing and preserving food, but also is wild and untameable; ultimately dangerous. This is often a fundamental thread in pagan beliefs; the dual nature of the world around us and everything in it, and the endless turning of the wheel. As one thing ends, so another begins.