In the Middle Ages horseshoes were nailed on the thresholds
of homes to keep out witches. The significance of the
horseshoe, however, is probably of more ancient origin, possibly
being related to the two-horn shape that was believed to
repel the evil eye in more ancient civilizations. This shape may
have derived from a belief in animal horns as a symbol of good
fortune. Iron as a metal is also traditionally believed to repel
witches, fairies, and evil spirits, and the horseshoe combined
both the shape and the metal that would ensure good fortune
and avert evil.
For protection the horseshoe charm was placed outside
buildings with the prongs pointing upward, so that the luck
would not run out, but in many buildings the horseshoe was
used indoors with the prongs pointing down, so that good luck
would be diffused inside the house.
Gypsies, who have a special relationship to horses, saw the
horseshoe as a charm against the demons of unhappiness, bad
luck, bad health, and death.
Trigg, E. B. Gypsy Demons and Divinities The Magical and Supernatural
Practices of the Gypsies. London Sheldon Press, 1973.