There is no such thing as poisoned candy or razor-bladed apples - it's an urban legend that does not happen in real life.
But that hasn't stopped generations of parents from telling generations of kids (like me!) that Halloween candy must be inspected carefully before eating because while our neighbors may seem nice and generous, in fact TONIGHT ONE OF THEM MAY MAKE AN ATTEMPT ON YOUR LIFE.
The myth of booby-trapped candy seems plausible at first, but quickly falls apart. When I was a kid, I could've told you exactly who gave me what candy at which house. If someone wants to hurt the children in their neighborhood, poisoning candy is no more anonymous than trying to wring their necks right there on the porch. Repeating this myth and inspecting candy scares our children for no reason. After all, you don't inspect every piece of candy (or any other food) from the grocery store, and that would be much easier to taint anonymously - there's just no urban legend surrounding grocery store candy.
The other damaging part of the myth is that we teach our children that packaged candy is "safe," but fruit, nuts or anything else not packaged is not, so our children end up eating nothing but sugar on Halloween. As John Oliver explains, that's actually the real danger at the scale Americans eat it (read more in Mother Jones):