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