Halloween means All Hallows Eve, (the night before 'All Hallows day' or 'All Souls Day' or 'All Saints Day')
The Ancient Druids of Europe had a sun/fire festival called "Samhain", which was strongly associated with faeries and winter spirits. Although the druids were largely destroyed by the invading Romans, folk memories of Samhain survived to become the genesis of Halloween.
The Roman festival of Feralia in honour of the departed spirits added a lot of the spookiness that later became associated with Halloween and the early christian All saint's day kept the memories of the earlier practices alive.
So today our 'All hallow's eve' parties are in fact a half forgotten memory of ancient festivals in honour of seasonal changes and memories of dead friends and family. That's pretty spooky in itself.
As Christianity spread, pagan holidays were either removed completely from the calendars or sanitised. For example Easter may nowadays be the festival related to Christ's cruxifiction but the eggs, bunnies, gifts and even the festival's name have pre-christian roots.
Halloween was another festival that was heavily Christianised, but the older folk memory connecting the ceremony to the spookier side of life was never fully cleaned away.
The custom of trick or treat dates back a few hundred years. Traditionally The poor would go from house to house receiving "soulcakes" in return for promising to say a prayer for the dead.
Over time the custom changed and children were allowed to go from house to house receiving treats.
Nowadays Halloween ranks second only to Christmas in total consumer dollars spent on parties, costumes, treats and decorations.

