Garlic secretes a specific substance called Allicin that is extremely effective in killing and repelling snails. Besides, the sulfur present in garlic will combine with Allicin and act on the snail's sensory receptors.