Halloween started as the Pagan holiday Samhain. This is the celebration of the new year in Paganism. However, it's slowly be changed into a wonderful children's holiday here in the United States.
So, how did this holiday come about? Well it appears to have started as Celtic Pagan tradition of celebrating what is the new year. The harvest should be done by now so everyone would come together to have a feast and celebrate the ability to rest a little bit over the winter months. Treats came about because the veil between the living and the dead is at it's thinnest on Samhain and treats are put out to appease these spirits.
This became the tradition of giving out treats to the children that we follow today. During this time, one could possibly see and/or talk to ancestors much easier than most nights because the veil is so thin on this night. This is one of the major Celtic holidays or Sabbats of the year for the Pagan tradition.
In this Celtic tradition, started in what is now Ireland, feasts were held to honor the dead and celebrate the end of the harvest. It is also believed that Celtics would dress up in costumes to scare away the evil spirits. So, how did Samhain become Halloween as we know it today?
On Samhain, people would go door to door collecting food that would be repaid on All Soul's Day. This practice was called "souling" and it is this practice that turning into trick or treating. This change occurred because Christians felt that converting some of the holidays of the Pagans would help their transition to Christianity rather then just banning their rituals outright. The Jack-o-Lantern became a tradition because it was used to scare away "Stingy Jack's" spirit on Halloween. Stingy Jack, according to the legend sold his soul to Satan, but in the end tricked him and he kept his soul. However, when he passed, God would not let him into Heaven so it is thought that Stingy Jack is stuck between Heaven and Hell.
And that is how Halloween came to be. It is a mix of Pagan and Christian rituals.
Have a great day!