4. Let the foci of an ellipse be $F_{1}(-1,0)$ and $F_{2}(1,0)$ with eccentricity $e$, and let the parabola with vertex at $F_{1}$ and focus at $F_{2}$ intersect the ellipse at point $P$. If $\frac{\left|P F_{1}\right|}{\left|P F_{2}\right|}=e$, then the value of $e$ is . $\qquad$
4. $\frac{\sqrt{3}}{3}$.

In the parabola, $p=4$, the directrix is $x=-3$, and $\left|P F_{2}\right|$ is the distance from point $P$ to the directrix.

In the ellipse, $\frac{\left|P F_{1}\right|}{\left|P F_{2}\right|}=e$, and $\left|P F_{2}\right|$ is also the distance from point $P$ to the left directrix.
Thus, the directrix of the parabola coincides with the directrix of the ellipse. Therefore, $\frac{a^{2}}{c}=3$.
Since $c=1$, we have $e=\frac{\sqrt{3}}{3}$.