The tradition of wearing costumes on Halloween dates back to the ancient Celtic festival of Samhain, when people believed that disguising themselves could help ward off harmful spirits.