‘Souling’, which trick-or-treating is loosely based on, involved poor people going to places to...
ask the dead for treats
offer sweets and cakes for the dead
offer prayers for the dead in exchange for 'soul cakes'
exchange dead people for cakes and sweets