As I briefly mentioned in my answer on your other question, this too comes from the traditions of old.
Performing antics in exchange for food and drink. This practice is called mumming, from which the practice of trick-or-treating evolved.
This means that "trick-or-treating" once actually had to do with tricks. Not just a weird saying. More of an in-...
On the Wikipedia page for Halloween Costumes it says:
An early reference to wearing costumes at Halloween comes from Scotland in 1585.
Looking at the external links on the page I found something that sort of explains this.
As the centuries wore on, people began dressing like these dreadful creatures, performing antics in exchange for food and drink. ...
Here is how the "trick or treat" of Halloween first caught on:
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.
After a brief lull during the sugar rations in World War Two, Halloween became a widespread holiday that ...