Everybody knows that one of the great dangers of Halloween is candy that has been tampered with. That's why modern families do things like Trunk or Treat celebrations, where approved cars park in a church lot and approved people hand out approved goodies, or going from store to store in a mall, because it's far less likely to get a poisoned candy bar from Forever 21. I mean, everybody knows that there's a danger of some maniac putting a razor blade in your kid's apple - that's why hospitals have offered free X-rays of Halloween candy.
Except that there are almost zero documented cases of poisoned candy and a tiny handful of documented cases of foreign objects in candy (and zero cases of razors in apples). So where did these stories come from? Nobody's quite sure; before the 1960s the urban legends almost all were about poisoned candy, but eventually someone started spinning tales of candy bars with needles and razor blades in apples. The tipping point may have been a real case in 1964, where an old lady handed out steel wool and ant poison to kids who she thought were too old to trick or treat, but she told them upfront what she was giving them. It wasn't an attempt to harm the kids, just to give them shitty treats. It's possible that case hit the popular conscious like an asteroid impact.
There have been cases of kids being killed by Halloween candy, but it's almost always targeted. In 1970 Ronald Clark O'Bryan poisoned a bunch of Pixie Stix and gave them to his son, who died. He also gave them to his daughter and three random children in an effort to make it seem like a madman had been giving out poisoned candy. The police investigated and discovered that none of the houses the children had visited had given out Pixie Stix; it turns out that O'Bryan had a big insurance policy on his son and was looking to collect. That horrible crime was clearly influenced by the urban legend... and likely gave birth to new iterations of that legend.
In 1982 there was an uptick in reports of doctored candy; that was the same year as the Tylenol poisonings (the reason why your medicine is all tamper proof now), so it's unclear whether the burst of reports were people imitating the poisoner or just people overreacting. Professor Joel Best of Fresno State has done extensive research into the history of claims of Halloween candy tampering and has found that many, many of the reports seem to be pranks kids play on their parents. Talking to the LA Times, Best said:
"My favorite," Best says, "was the kid who brought a half-eaten candy bar to his parents and said, 'I think there's ant poison on this.' They had it checked and, sure enough, there was ant poison on it — significantly, on the end he had not bitten." Of course, the youngster had applied the poison himself.
Every few years there are reports of deaths that come from 'Halloween sadism' (as Best calls it, an attempt to categorize random attacks on trick or treaters using tampered candy, as opposed to situations like the O'Bryan case), but almost all - if not every single one - has been disproven. A common theme is an early major headline talking about a kid who died while trick or treating with the speculation that the candy was poisoned... later followed up by a smaller story that reveals the kid had a heart problem or had stumbled on a relative's heroin stash (both true stories).
So why do these stories keep popping up? They really speak to something about Halloween and the space between community - we're all going door to door and asking for candy - and scariness - we're all doing it in costume and some of the doors are pretty scary looking. The original legends sprang up during the great suburbanization of America, a time when people were escaping cities for planned Levittowns, but taking with them their urban fears. Those urban fears mixed with the anonymity and distancing of suburban life - you may have been afraid of the stranger on your street in the city, but you knew everybody in your building. In the suburbs all of the samey houses hid people you only briefly saw driving by or mowing their lawns. It's a measure of the way societal bonds began breaking down post-WWII.
At the same time it's also perfect for Halloween. It's the scariest holiday, so it should have the scariest lore. The truth is a little less scary - Halloween has the fourth highest child injury rate, coming in just ahead of Easter. The main culprit in Halloween injuries: getting hit by cars.