The "trick" part of trick-or-treat has almost been forgotten these days. The typical Halloween greeting we use to ask for candy is indeed a threat, but one that children don't take seriously these days. However, before World War II, Halloween mischief was serious and rampant.
Immigrants from Ireland and Scotland brought their Halloween superstitions to America in the 18th and 19th centuries, and their youngsters—our great- and great-great grandfathers—became the first American masterminds of mischief. Kids strung ropes across sidewalks to trip people in the dark, tied the doorknobs of opposing apartments together, mowed down shrubs, upset swill barrels, rattled or soaped windows, and, once, filled the streets of Catalina Island with boats. Pranksters coated chapel seats with molasses in 1887, exploded pipe bombs for kicks in 1888, and smeared the walls of new houses with black paint in 1891. Two hundred boys in Washington, D.C., used bags of flour to attack well-dressed folks on streetcars in 1894.
When these things happened in small towns, it was fairly easy for adults to figure out who did it. They either gave the miscreants a good dressing-down and made them repair the damage, or else they sighed and were thankful it was only one night a year. But the urbanization of America meant that strangers were living close together, and people did not feel like putting up with property damage and vandalism anymore. Read about the many efforts to turn Halloween away from tricks and toward treats at Smithsonian.