As the secular Samain and sacred All Hallow's intertwined, the dead spirits that characterized the holiday assumed more negative connotations (hence the modern Halloween icons of witches, ghosts and ghouls). To appease those evil spirits, people left food and drink outside to protect their homes from spiritual retaliation. Gradually, savvy celebrants took advantage of the tasty offerings by dressing up as the dead and trekking from door to door to ask for provisions in exchange for protection from wicked spirits. According to the American Folklife Center, the practice, which became known as mumming, served as a precedent for trick-or-treating.
In England, the poor would organize soul parades to beg for alms on All Hallow's Eve in exchange for prayers to deliver dead souls from purgatory to heaven. As the years wore on, children took over the tradition, calling themselves "soulers." Bands of them would knock on doors and sing songs in return for sweet, currant-topped breads called soul-cakes. The trick-or-treating custom crossed the Atlantic with the influx of immigrants from England and Ireland that moved to the United States in the mid-19th century.