Today, it’s hard to imagine a Halloween not filled with doorbells, costumes, and treats. In 2016 Americans spent $8.4 billion on the holiday. But while trick-or-treating is many children’s favorite pastime, it hasn’t been a pastime for all that long. The tradition didn’t make its way to North America until the 1920s and 30s, first taking root in the West. Almost as quickly as the tradition started, it was nearly derailed. It took the combined efforts of cartoons, comics and candy manufacturers to resurrect trick-or-treating after World War II and make it what it is today.

Not only did World War II bring unspeakable death and destruction to the world, it also affected the goods and services available to civilians at home. In an effort to help alleviate hoarding, price hikes—and angry citizens—the Office of Price Administration printed War Ration Books with stamps that were used in exchange for goods. Sugar was the first consumer commodity to be rationed, as one-third of American sugar imports came from the Japanese occupied Philippines. War Ration Book Number One—nicknamed the “Sugar Book”—was handed out on May 4, 1942. With deep cuts to sugar allowances (half a pound a week, 50 percent less than pre-war consumption levels), it came as no surprise that children’s Halloween celebrations had to be adjusted.

In an effort to ration sugar, coupons from the War Ration Books assured a just distribution of the nation’s sugar supply to all, July 1942. (Credit: Anthony Potter Collection/Getty Images)

When sugar rationing finally came to an end in June 1947, the commercialization of Halloween took off. Candy companies like Curtiss and Brach wasted no time in launching their Halloween advertising campaigns. But it wasn’t just candy companies that had stock in the reemergence of these festive celebrations. As early as fall 1947, the children’s magazines Jack and Jill and Children’s Activities both featured trick-or-treating in their October issues.

The iconic comic trip Peanuts joined in on the fun four years later when they ran three Halloween-themed strips from October 29 – October 31, 1951. Charles Schulz drew his iconic characters in ghost costumes, preparing for “Halloween ghosting.” Patty even used Charlie Brown as the model for her jack-o’-lantern carving. These comic strips helped spread the popularity of Halloween.

VIDEO: Donald Duck – Trick or Treat (Credit: Laser Time & Disney)

The following year, Disney also re-popularized trick-or-treating with an eight-minute short film that showed youngsters exactly how it was done. The short, Donald Duck – Trick or Treat, opens on Witch Hazel flying on a broomstick named Beelzebub. She watches as Huey, Dewey and Louie trot up to their Uncle Donald Duck’s house, all wearing costumes and carrying bags to collect the apple-of-their-eye, candy. Uncle Donald, however, is more interested in tricks than the treats, and places firecrackers in each of his nephew’s bags, which explode. Witch Hazel witnesses the whole event and decides to help the kids. The rest of the cartoon shows a battle between Witch Hazel and the nephews versus Donald Duck, as each tries to out trick the other. Kids worldwide could now see exactly how to trick AND treat.

By 1952, the tradition of trick-or-treating was firmly established, and grew in size every year since. In addition to television and magazines, schools began reinforcing the trick-or-treat tradition, when the United Nations International Children’s Emergency Fund (UNICEF) launched a national campaign to raise money for children in 1950. They handed out cardboard boxes for kids to take with them while trick-or-treating. The kids were told to ask for any spare coins when collecting their candy, a tradition that has proved quite lucrative, raising more than $175 million for the U.S. Fund for UNICEF.