It all began nearly 2,000 years ago, with the ancient Celtic festival of Samhain (pronounced sow-in). The Celts, who lived around what is now Ireland and the UK, celebrated the New Year on November 1st (crops die, days get shorter, etc.), and believed that on the night before, the real world and the spirit world would meet.
These visits from the ghosts of the dead could be dangerous, of course, so the Celts and Druids wore animal costumes for protection. After the rise of Christianity, the night before the autumn festival became known as All-hallows Eve. The American celebration emerged from the combination of many different immigrant traditions.