The medieval Catholic focus on the dead at the time of All Hallows Eve is at the root of Halloween as we know it.. By the fourteenth century a custom called 'souling' had developed in England in which the poor would go from house to house asking for soul-cakes. The better-off would give out small cakes or loaves in exchange for prayers for their dead relatives. Souling continued up until the twentieth century in some parts of Britain, though the ritual became increasingly secularised and was eventually relegated to children. Souling almost certainly forms the basis for American 'Trick or Treating'. Shakespeare uses the phrase 'to speak pulling like a beggar at Hallowmass'. I'll note that both of my parents, who grew up in Detroit, Michigan in the 40s and 50s, refer to the practice of trick-or-treating as 'begging' and to trick-or- treaters as 'beggars'. The phrase they used to ask for treats as children was 'Help the poor!'