Why do children say "Trick or treat" when they come to the door on Halloween?
There are two possible meanings. Both come from Halloween customs that have died out:
Children used to do "tricks", like singing songs, in return for the treats.
They also used to play "tricks", meaning harmless pranks, on people who wouldn't give them treats. For example, they would put soap all over the house's windows. This is not acceptable anymore.