Garlic releases a sulfur gas called allicin when it is attacked by insects. The compound is toxic to bugs if they consume it. Allicin is also the compound that causes the strong odor in garlic. When we consume garlic, the smell can be emitted through our skin and interfere with bugs’ sense of smell. This makes it hard for bugs to smell us and therefore bite us. Allicin, however, breaks down quickly when heated, so you may want to consider eating your garlic raw.