4. Let $F$ be the left focus of the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$, and $A$ be a point on the ellipse in the first quadrant. Draw a tangent line from point $A$ to the circle $x^{2}+y^{2}=b^{2}$, with the point of tangency being $P$. Then $|A F|-|A P|=$
4. $a$.

Let $F(-c, 0), A(a \cos t, b \sin t)\left(t \in\left(0, \frac{\pi}{2}\right)\right)$.
$$
\begin{array}{l}
\text { Then }|A F|=\sqrt{(a \cos t+c)^{2}+(b \sin t)^{2}} \\
=\sqrt{a^{2} \cos ^{2} t+2 a c \cos t+c^{2}+\left(a^{2}-c^{2}\right) \sin ^{2} t} \\
=\sqrt{a^{2}+2 a c \cos t+c^{2} \cos ^{2} t}=a+c \cos t \\
\text { Also }|A P|=\sqrt{A O^{2}-O P^{2}} \\
=\sqrt{(a \cos t)^{2}+(b \sin t)^{2}-b^{2}} \\
=\sqrt{\left(a^{2}-b^{2}\right) \cos ^{2} t}=c \cos t,
\end{array}
$$
$$
\text { Therefore }|A F|-|A P|=a \text {. }
$$