12. Given the ellipse $C: \frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$, $F_{1} 、 F_{2}$ are its left and right foci, $Q$ is any point on the ellipse $C$, and the centroid and incenter of $\triangle F_{1} Q F_{2}$ are $G 、 I$, respectively. The line $I G$ is parallel to the $x$-axis. Then the eccentricity of the ellipse $C$ is
12. $\frac{1}{2}$.

Let $Q\left(x_{0}, y_{0}\right)$. From the problem, the y-coordinates of points $G$ and $I$ are both $\frac{1}{3}\left|y_{0}\right|$. Therefore, the inradius of $\triangle F_{1} Q F_{2}$ is
$$
r=\frac{1}{3}\left|y_{0}\right| .
$$

Then, $S_{\triangle F_{1} Q F_{2}}=\frac{1}{2}\left|F_{1} F_{2}\right|\left|y_{0}\right|$
$$
=\frac{1}{2}\left(\left|Q F_{1}\right|+\left|Q F_{2}\right|+\left|F_{1} F_{2}\right|\right) r \text {, }
$$

which means $\frac{1}{2} \times 2 c\left|y_{0}\right|=\frac{1}{2}(2 a+2 c) \frac{1}{3}\left|y_{0}\right|$.
Thus, $a=2 c, e=\frac{c}{a}=\frac{1}{2}$.