Based from "Trick or Treat" states this from the Wiki: "Trick-or-treating is a traditional Halloween custom for children and adults in some countries. In the evening before All Saints' Day (1 November), children in costumes travel from house to house, asking for treats with the phrase "Trick or treat". The "treat" is usually some form of candy, although in some cultures money is given instead. The "trick" refers to a threat, usually idle, to perform mischief on the homeowner(s) or their property if no treat is given. Trick-or-treating usually occurs on the evening of October 31. Some homeowners signal that they are willing to hand out treats by putting up Halloween decorations outside their doors; others simply leave treats available on their porches for the children to take freely. Houses may also leave their porch light on as a universal indicator that they have candy."
"In Scotland and other parts of Britain and Ireland, the tradition of guising, going house to house at Halloween and putting on a small performance to be rewarded with food or treats, goes back at least as far as the 16th century, as does the tradition of people wearing costumes at Halloween. There are many accounts from 19th-century Scotland and Ireland of people going house to house in costume at Halloween, reciting verses in exchange for food, and sometimes warning of misfortune if they were not welcomed. While going house to house in costume has long been popular among the Scots and Irish, it is only in the 2000s that saying "Trick or treat" has become common in Scotland and Ireland. Prior to this, children in Ireland would commonly say "Help the Halloween Party" at the doors of homeowners."
'In North America, trick-or-treating has been a Halloween tradition since the 1920s. The earliest known occurrence there of the Irish and Scottish Halloween custom of "guising" – children going from house to house for food or money while disguised in costume – is from 1911, when children were recorded as having done this in Ontario, Canada. The activity is prevalent in the United Kingdom, Ireland, the United States, Canada, and Australia. In northwestern and central Mexico, this practice is called calaverita (Spanish diminutive for calavera, "skull" in English), and instead of "Trick or treat", the children ask, "¿Me da mi calaverita?" ("Can you give me my little skull?"), where a calaverita is a small skull made of sugar or chocolate."
Ancient precursors: "Traditions similar to the modern custom of trick-or-treating extend all the way back to classical antiquity, although it is extremely unlikely that any of them are directly related to the modern custom. The ancient Greek writer Athenaeus of Naucratis records in his book The Deipnosophists that, in ancient times, the Greek island of Rhodes had a custom in which children would go from door-to-door dressed as swallows, singing a song, which demanded the owners of the house to give them food and threatened to cause mischief if the owners of the house refused. This tradition was claimed to have been started by the Rhodian lawgiver Cleobulus."
Origins: "Since the Middle Ages, a tradition of mumming on a certain holiday has existed in parts of Britain and Ireland. It involved going door-to-door in costume, performing short scenes or parts of plays in exchange for food or drink. The custom of trick-or-treating on Halloween may come from the belief that supernatural beings, or the souls of the dead, roamed the earth at this time and needed to be appeased. It may otherwise have originated in a Celtic festival, Samhain, held on 31 October–1 November, to mark the beginning of winter, in Ireland, Scotland and the Isle of Man, and Calan Gaeaf in Wales, Cornwall, and Brittany. The festival is believed to have pre-Christian roots. In the 9th century, the Catholic Church made 1 November All Saints' Day. Among Celtic-speaking peoples, it was seen as a liminal time, when the spirits or fairies (the Aos Sí), and the souls of the dead, came into our world and were appeased with offerings of food and drink. Similar beliefs and customs were found in other parts of Europe. It is suggested that trick-or-treating evolved from a tradition whereby people impersonated the spirits, or the souls of the dead, and received offerings on their behalf. S. V. Peddle suggests they "personify the old spirits of the winter, who demanded reward in exchange for good fortune". Impersonating these spirits or souls was also believed to protect oneself from them."
"At least as far back as the 15th century, among Christians, there had been a custom of sharing soul-cakes at Allhallowtide (October 31 through November 2). People would visit houses and take soul-cakes, either as representatives of the dead, or in return for praying for their souls. Later, people went "from parish to parish at Halloween, begging soul-cakes by singing under the windows some such verse as this: 'Soul, souls, for a soul-cake; Pray you good mistress, a soul-cake!'" They typically asked for "mercy on all Christian souls for a soul-cake". It was known as 'Souling' and was recorded in parts of Britain, Flanders, southern Germany, and Austria. Shakespeare mentions the practice in his comedy The Two Gentlemen of Verona (1593), when Speed accuses his master of "puling [whimpering or whining] like a beggar at Hallowmas".
"The wearing of costumes, or "guising", at Hallowmas, had been recorded in Scotland in the 16th century and was later recorded in other parts of Britain and Ireland. There are many references to mumming, guising or souling at Halloween in Britain and Ireland during the late 18th century and the 19th century. In parts of southern Ireland, a man dressed as a Láir Bhán (white mare) led youths house to house reciting verses—some of which had pagan overtones—in exchange for food. If the household donated food it could expect good fortune from the 'Muck Olla', but if they refused to do so, it would bring misfortune. In Scotland, youths went house to house in white with masked, painted or blackened faces, reciting rhymes and often threatening to do mischief if they were not welcomed."
"In parts of Wales, peasant men went house to house dressed as fearsome beings called gwrachod, or presenting themselves as the cenhadon y meirw (representatives of the dead). In western England, mostly in the counties bordering Wales, souling was common. According to one 19th century English writer "parties of children, dressed up in fantastic costume […] went round to the farm houses and cottages, singing a song, and begging for cakes (spoken of as "soal-cakes"), apples, money, or anything that the goodwives would give them".