If you look into the traditions and beyond the supernatural window dressing, many of them focus on reinforcing the ties between community members, which would have been vitally important pre-industrial agriculture with the winter starting and with it the possibilities of food shortages, illness, the approach of storms, etc. — not that they’re any less important now.
The bonfire was the center of the post-Christian Samhain/early-All Hallow’s Eve celebrations in the Celtic lands. Some traditions had every house in a village extinguish the fires in their own hearths (possible to make them less inviting to roaming spirits) and relight them with burning sticks from the communal bonfire (which they may have brought home in hollowed out turnips). The message was clear: we’re all in this together.
Another tradition has it that two bonfires should be set up a short distance apart and the villagers’ cattle herded between them for good luck. I’ve also read that this tradition was also practiced during the midsummer festival/St. John’s Night, so perhaps it was something that was customary at both the midpoint and start of the year?
When I was a kid people sometimes added a guy to the Halloween bonfire, but that was inspired by Guy Fawkes Night/Bonfire Night (Remember, remember the 5th of November…) and had nothing to do with Halloween or Samhain.
Turnips were originally carved and a candle or burning ember placed inside. Pumpkins only came along when New World was settled. There appear to be several stories that explain the “jack-o-lantern.” One is that the hollowed-out turnip was used to carry the burning ember from the bonfire back to a family’s cottage. The other is that the boys who went guising (“disguising”) — the medieval English tradition of going from house to house begging for soul-cakes (now known as hot cross buns) in return for prayers for the souls of the dead — would carry one, either to light their way or as something that was symbolic of the dead. Guising, which obviously evolved into trick or treating, was common from the middle ages on and I believe still goes on in parts of Scotland. Why they needed to be disguised is less clear: perhaps as a protection in case the vengeful dead were looking for you, or perhaps to allow the dead to infiltrate their ranks and enjoy a night partying as if they were alive once again? Again, the tradition would seem to be something that reinforced social connections and shared the history of the community.
It’s notable that in Ireland and Scotland, treats were given in return for performance (a song or a story) which is in keeping with traditions like the curaid (the circuit) and general respect for storytelling and musicianship.