It's just a harmless enzyme reaction, which happens due to an enzyme calledalliinase, which breaks down the amino acidalliin intoallicin. Allicin is what makes the garlic turn blue when pickled in a vinegar solution.