Before Christ founded His Church, the people had their celebrations and festivals such as the beginning of winter “darker half” of the year.
Also, history tells the story of how the pagan Romans celebrated what was called Lemuralia (or Lemuria) dedicated to appeasing evil spirits. However, as Christianity spread by the 7th century, many Western European nations had converted to Christianity. These pagan feast days gradually changed to a Christian way of thinking about the dead, and during the 8th century, Pope Gregory III moved the annual festival to All Saints’ Day for Romans to November 1. This change took place during the celebrations known as Samhain. Pope Gregory IV made the replacement for the Western Church.
It was called the eve before All Saints’ Day and dubbed All Hallows’ Eve which evolved into today’s modern-day Halloween. Halloween is All-Hallows’-Eve which is the night-before-All-Saints’- Day.
Interesting tidbit from the Catholic Education resource center:
Begging at the door grew from an ancient English custom of knocking at doors to beg for a “soul cake” in return for which the beggars promised to pray for the dead of the household. Soul cakes, a form of shortbread and sometimes quite fancy, with currants for eyes became more important for the beggars than prayers for the dead, it is said. Florence Berger tells in her Cooking for Christ a legend of a zealous cook who vowed she would invent soul cakes to remind them of eternity at every bite. So she cut a hole in the middle and dropped it in hot fat, and lo a doughnut. Circle that it is, it suggests the never-ending of eternity. Truth or legend, it serves a good purpose at Halloween.
The refrains sung at the door varied from “a soul cake, a soul cake, have mercy on all Christian souls for a soul cake,” to the later:
Soul, soul, an apple or two,
If you haven’t an apple, a pear will do,
One for Peter, two for Paul,
Three for the Man Who made us all.