This article is from the Food Preserving FAQ, by Eric Decker firstname.lastname@example.org with numerous contributions by others.
The sulfur compounds in garlic (thiols or some type) can be
broken up by active enzymes in the garlic allowing the sulfur
to react with any copper in solution. This results in copper
sulfides which is what you see as the "blue" discoloration.
The enzymes can be denatured by high temperature processing.
My understanding is that the enzymes are more abundant in immature
garlic. The amount of copper required is tiny, but my further
understanding is that ordinary table salt should not be used
in preference to "canning salt". In any case the blue discoloration
presents no hazard. The conventional wisdom for eliminating
blue garlic seems to be:
1.) Use mature garlic (lower enzyme content)
2.) Process at high temperature (denature enzyme)
3.) Use "canning salt" (remove source of copper)
An off topic note about thiols: These are the compounds that
give skunks that "twang". Sulfur seems to be natures way
of making things stink (either good or bad).
From: Steve Kissel