It's when people, usually kids and youth, dress up in costumes for fun. They go around door to door, and people give out candy to them. Usually they say "Trick or treat" at every door, or they're supposed to. And then depending on into the holiday people are, they may say 'trick' first, and then give them candy, or just hand over the candy. It's mostly just for fun. Kids enjoy it, they get to pretend to be someone else for a night, and they get candy.
It's fun. Not all the places are haunted, often it's just people dressed up as monsters scaring people. It's all just part of the tradition.