They went dressed up as angels, demons or saints. The soul cakes were sweet, with a cross marked on top and when eaten they represented a soul being freed from purgatory.
Nicholas Rogers, a historian at York University says that when people prayed for the dead at Hallow Mass, they dressed up. When praying for fertile marriages, the boy choristers in the churches dressed up as virgins. So there was a certain degree of cross dressing in the actual ceremony of All Hallows Eve
The phrase trick-or-treat was first used in America in 1927, with the traditions brought over to America by immigrants. Guising gave way to threatening pranks in exchange for sweets.