A way back when people went "A souling!" on the Feats of all Souls, and beggars and others were giving Souls Cakes in exchange for a promise to pray for the souls in Purgatory. A Soul cake isn't a mere cookie, but a thick confection rich mixture of spices , nuts, and dried fruit, a lot of tasty morsels as pay for repeating a few prays. In the more recent past it was time for parties, where of course many treats were served. Sometime around the early 1900s, when the pranks and general tomfoolery got to be too much for most towns Halloween parades and door to door "Trick or Treating" began, and of course the bribes for no soaped windows, etc, was candy, or cookies, woe to the house that handed out apples, though.
May-be this is a stretch, but may-be not. Deep inside I think that sharing food and fattening up for the winter was a part of the All American Halloween.