The tradition originated with the ancient Celtic festival of Samhain, when people would light bonfires and wear costumes to ward off ghosts. ... Over time, Halloween evolved into a day of activities like trick-or-treating, carving jack-o-lanterns, festive gatherings, donning costumes and eating treats.
"Hallow" — or holy person — refers to the saints celebrated on All Saints' Day, which is November 1. The "een" part of the word is a contraction of "eve" — or evening before. So basically, Halloween is just an old-fashioned way of saying "the night before All Saints' Day" — also called Hallowmas or All Hallows' Day.
Samhain was a celebration of the end of the harvest season, meaning 'summer's end'. Gaels in this period are thought to have believed this time of year was also when the walls between the worlds were thin and porous and enabled spirits to pass through. ... Bonfires would also be lit to scare off evil spirits.