Garlic has long been held as a universal ward against evil. There is plenty of information about how it purifies the blood, keeps away blood sucking insects, gives strength, courage, and bestows other attributes.
But here is what’s not talked about. Garlic is easy to produce. Garlic is not super particular about where and how it grows. It was also cheap for the peasant masses. Fields of garlic were not uncommon in Ancient Greece, Egypt, Rome, and Europe. Its white color also lent itself to the idea that it was pure and sacred.
While consumption of garlic was used for many benefits, warding away vampires and other forces started first as a kind of threshold barrier. Bulbs or ropes of bulbs were hung in the home for protection. From there people extrapolated that if the hanging of bulbs could protect the home, why not individuals? So people began carrying and wearing bulbs of garlic to keep all manner of evil spirits (including vampires) away.
Nothing specific is written about what the garlic does to a vampire, simply that they cannot tolerate it. Because of garlic’s pungent aroma, most beliefs focus on this idea, but there’s very little to substantiate it. Another idea is that because garlic has purifying aspects, and because it can keep bloodsucking insects at bay, the garlic purifies the blood, making it dangerous for vampires to consume.