Halloween is a holiday that you see people dressing up but the reason why they pass out the candy to people is becauses "Candy companies soon realized that housewives would much rather pass out pre-packaged treats than spend all day in their kitchens cooking, so candy soon became very popular,".So basically thats why they had started passing out candy in the world after they saw that.