We systematically study the origins and mechanisms for unintentional incorporation of gallium (Ga) during epitaxial growth of ternary InAlN thin-film layers. The origins of auto-incorporation of Ga have been investigated by using different underlying layers, regrown layers, and growth chamber conditions. It is shown that Ga-containing deposition on a wafer susceptor/carrier and on surrounding surfaces of uncooled parts in a growth chamber can be responsible for Ga in the InAl(Ga)N layers, while a GaN underlying layer below an InAl(Ga)N layer does not contribute to the auto-incorporation of Ga in the InAl(Ga)N layers. Especially, the Ga-containing deposition on the surfaces inside the chamber is believed to be the dominant source of auto-incorporated Ga, possibly due to the high vapor pressure of a liquid phase as a result of eutectic system formation between indium (In) and Ga. The pressure of liquid-phase Ga, p Ga =~3.67×10 −4 Torr, can be significant as compared to precursor partial pressures with p TMAl =3.7×10 −4 Torr and p TMIn =2.4×10 −5 Torr. In addition, magnesium (Mg) or magnesium precursor (Cp 2 Mg) in the growth chamber is shown to promote the auto-incorporation of Ga in the InAl(Ga)N layers.