Trick-or-treating grew out of older Halloween customs in Scotland and Ireland, especially guising, in which people in costume went house to house and offered a short verse, song, or performance in exchange for food or treats; this tradition goes back at least to the 16th century. Related door-to-door customs, such as souling (asking for soul cakes at Allhallowtide) and mumming in Britain, and the Celtic festival of Samhain on October 31 to November 1, are also cited as possible roots. In North America, Halloween guising was first recorded in British Columbia in 1898, and the phrase “trick or treat” was first recorded in Ontario in 1917. The custom spread across the United States in the 1930s and 1940s, slowed only by World War II sugar rationing from 1942 to 1947.
Source: Wikipedia, “Trick-or-treating”
Image: Trick-or-treaters in Beaumont, California, from the Beaumont Daily Gazette, October 26, 1950 (public domain), via Wikimedia Commons.