This situation can happen in otherwise corrosion-resistant alloys, when the grain boundaries are depleted, known as , of the corrosion-inhibiting elements such as chromium by some mechanism. In nickel alloys and austenitic stainless steels, where chromium is added for corrosion resistance, the mechanism involved is precipitation of chromium carbide at the grain boundaries, resulting in the formation of chromium-depleted zones adjacent to the grain boundaries (this process is called sensitization).  Around 12% chromium is minimally required to ensure passivation, a mechanism by which an ultra thin invisible film, known as passive film, forms on the surface of stainless steels.  This passive film protects the metal from corrosive environments. The self-healing property of the passive film make the steel stainless. Selective leaching often involves grain boundary depletion mechanisms.
These zones also act as local galvanic couples, causing local galvanic corrosion. This condition happens when the material is heated to temperatures around 700 °C for too long a time, and often occurs during welding or an improper heat treatment. When zones of such material form due to welding, the resulting corrosion is termed weld decay. Stainless steels can be stabilized against this behavior by addition of titanium, niobium, or tantalum, which form titanium carbide, niobium carbide and tantalum carbide preferentially to chromium carbide, by lowering the content of carbon in the steel and in case of welding also in the filler metal under 0.02%, or by heating the entire part above 1000 °C and quenching it in water, leading to dissolution of the chromium carbide in the grains and then preventing its precipitation. Another possibility is to keep the welded parts thin enough so that, upon cooling, the metal dissipates heat too quickly for chromium carbide to precipitate. The ASTM A923, ASTM A262, and other similar tests are often used to determine when stainless steels are susceptible to intergranular corrosion. The tests require etching with chemicals that reveal the presence of intermetallic particles, sometimes combined with Charpy V-Notch and other mechanical testing.
Another related kind of intergranular corrosion is termed knifeline attack (KLA). Knifeline attack impacts steels stabilized by niobium, such as 347 stainless steel. Titanium, niobium, and their carbides dissolve in steel at very high temperatures. At some cooling regimes (depending on the rate of cooling), niobium carbide does not precipitate and the steel then behaves like unstabilized steel, forming chromium carbide instead. This affects only a thin zone several millimeters wide in the very vicinity of the weld, making it difficult to spot and increasing the corrosion speed. Structures made of such steels have to be heated in a whole to about 1065 °C (1950 °F), when the chromium carbide dissolves and niobium carbide forms. The cooling rate after this treatment is not important, as the carbon that would otherwise pose risk of formation of chromium carbide is already sequestered as niobium carbide.
[https://web.archive.org/web/20060421214659/http://httd.njuct.edu.cn/matweb/corrosie/c_iga.htm]
Aluminium-based alloys may be sensitive to intergranular corrosion if there are layers of materials acting as anodes between the aluminium-rich crystals. High strength aluminium alloys, especially when extruded or otherwise subjected to high degree of working, can undergo exfoliation corrosion (metallurgy), where the corrosion products build up between the flat, elongated grains and separate them, resulting in lifting or leafing effect and often propagating from edges of the material through its entire structure. [http://www.corrosion-doctors.org/Forms-exfoliation/exfoliation.htm] Intergranular corrosion is a concern especially for alloys with high content of copper.
Other kinds of alloys can undergo exfoliation as well; the sensitivity of cupronickel increases together with its nickel content. A broader term for this class of corrosion is lamellar corrosion. Alloys of iron are susceptible to lamellar corrosion, as the volume of iron oxides is about seven times higher than the volume of original metal, leading to formation of internal tensile stresses tearing the material apart. Similar effect leads to formation of lamellae in stainless steels, due to the difference of thermal expansion of the oxides and the metal. [http://www.corrosion-doctors.org/Forms/lamellar.htm]
Copper-based alloys become sensitive when depletion of copper content in the grain boundaries occurs.
Anisotropic alloys, where extrusion or heavy working leads to formation of long, flat grains, are especially prone to intergranular corrosion. [http://www.corrosion-doctors.org/Forms-intergranular/intergranular.htm]
Intergranular corrosion induced by environmental stresses is termed stress corrosion cracking. Inter granular corrosion can be detected by ultrasonic and eddy current methods.