A localization of a localization is itself a localization. Essentially for the same reason that a fraction of fractions is just a fraction.
Proposition. Let $A$ be a commutative ring with $1$; let $S$ be a multiplicative subset of $A$, and let $R=S^{-1}A$ be the localization of $A$ at $S$. Let $T$ be a nonempty multiplicative subset of $R$, and let $U\subseteq A$ be the set $U = \left\{ u\in A\ \left|\ \exists s\in S\text{ such that }\frac{u}{s}\in T\right\}\right..$ Then $U$ is a multiplicative subset of $A$, and \frac{(r/s')}{(u/s)} \longmapsto \frac{rs}{us'} is an isomorphism $T^{-1}R\to U^{-1}A$.
I'll give two proofs: a "pedestrian" one and a fancy one.
Proof the Pedestrian. First, we prove that $U$ is a multiplicative subset of $A$: if u,u'\in A, then there exist s,s'\in S such that \frac{u}{s},\frac{u'}{s'}\in T. Since $T$ is multiplicative, \frac{uu'}{ss'}\in T, hence uu'\in U. So $U$ is multiplicative.
Second, if $u\in U$ and s'\in S, then us'\in U; that is, $U$ absorbs multiplication by elements of $S$: for there exists $s\in S$ such that $\frac{u}{s}\in T$. Then, since \frac{us'}{ss'} = \frac{u}{s}, and ss'\in S, then us'\in T, as claimed.
Therefore, \frac{rs}{us'} makes sense as an element of $U^{-1}A$.
Next, we show that the map is well-defined. If \frac{r/s'}{u/s} = \frac{\rho/\sigma'}{\vartheta/\sigma} in $T^{-1}R$, then there exists $\frac{x}{y}\in T$ such that \frac{x}{y}\left(\frac{r\vartheta}{s'\sigma} - \frac{u\rho}{s\sigma'} \right)= 0_R, which is equivalent to \frac{x(r\vartheta s\sigma' - u\rho s'\sigma)}{yss'\sigma\sigma'} = 0_R, which in turn is equivalent to saying that there exists $z\in S$ such that zx(r\vartheta s\sigma' - u\rho s'\sigma) = 0_A. But since $\frac{x}{y}\in T$, then $x\in U$; and since $z\in S$, then $zx\in U$. Therefore, the equation written above implies that in $U^{-1}A$ we have \frac{rs}{us'} = \frac{\rho \sigma}{\vartheta\sigma'}, which is exactly what wee need for the map to be well defined.
Showing that the map is a homomorphism is now easy, just as doing fraction arithmetic. We have: \begin{align*} \frac{r/s'}{u/s} + \frac{x/y}{z/w} &= \frac{\frac{rz}{s'w} + \frac{xu}{ys}}{\frac{uz}{sw}}\\ &= \frac{\quad\frac{rzys + xus'w}{s'wys}}{\frac{uz}{sw}}\\ &\longmapsto \frac{(rzys + xus'w)(sw)}{uzs'wys} = \frac{rzys + xus'w}{uzs'y}.\\ \frac{rs}{s'u} + \frac{xw}{yz} &= \frac{rsyz + xws'u}{s'uyz}.\\ \frac{r/s'}{u/s} \times \frac{x/y}{z/w} &= \frac{\quad \frac{rx}{s'y}\quad}{\frac{uz}{sw}}\\ &\longmapsto \frac{rxsw}{s'yuz}.\\ \frac{rs}{s'u}\times \frac{xw}{yz} &= \frac{rsxw}{s'uyz}. \end{align*}
Now assume that \frac{r/s'}{u/s} maps to $0$. That means that \frac{rs}{us'} = 0_{U^{-1}A}, so there exists $\vartheta\in U$ such that $\vartheta(rs)=0$. But then there exists s''\in S such that \frac{\vartheta}{s''}\in T, and \frac{\vartheta}{s''}\cdot\frac{r}{s'} = \frac{\vartheta r}{s''s} = 0_{R} because $s\in S$ and $s(\vartheta r) = 0$. So the map is one-to-one.
Finally, given $\frac{a}{u}\in U^{-1}A$, there exists $s\in S$ such that $\frac{u}{s}\in T$; then $\frac{a/s}{u/s}\mapsto \frac{as}{us} = \frac{a}{u}$, so the map is onto. Thus, we have an isomorphism. $\Box$
The proposition can also be proven by invoking the Universal Property of the Localization: if $S$ is a multiplicative subset of $A$ and $\psi\colon A\to S^{-1}A$ is the canonical map, then for every commutative ring $R$ and every ring homomorphism $\varphi\colon A \to R$ such that $\varphi(s)$ is a unit in $R$ for every $s\in S$, there exists a unique $\Phi\colon S^{-1}A\to R$ such that $\varphi=\Phi\circ\psi$.
The map $\Phi$ is necessarily given by $\Phi(\frac{a}{s}) = \varphi(a)\varphi(s)^{-1}$.
Proof the Fancy. Let $A$, $S$, $R$, $T$, and $U$ be as in the statement of the proposition, let $\varphi\colon A\to R$ be the canonical map, $\varphi(a) = \frac{as_0}{s_0}$ (for some fixed $s_0\in S$, say); and $\psi\colon A\to U^{-1}A$ be the canonical map $\psi(a)=\frac{au_0}{u_0}$. Let $\theta\colon R\to T^{-1}R$ be the canonical map, $\theta(r)=\frac{rt_0}{t_0}$. Write $t_0 = \frac{\rho_0}{\sigma_0}$.
First, we would prove, as above, that $U$ is a multiplicative subset and absorbs multiplication by elements of $S$.
Now consider the composition $A\to S^{-1}A\to T^{-1}R$. If $u\in U$, then there exists $s\in S$ such that $\frac{u}{s}\in T$; then $\frac{u}{s}$ is mapped to a unit in $T^{-1}R$; but $s$ is mapped to a unit in $S^{-1}A$, so $\frac{ss}{s}\in S^{-1}A$ is mapped to a unit in $T^{-1}R$. Thus, the product $\frac{uss}{ss}$ is mapped to a unit, but this is the image of $u$ in $T^{-1}R$. Hence the compositum $A\to S^{-1}A\to T^{-1}R$ maps every $u\in U$ to a unit, so the map factors through $U^{-1}A$; this gives the map $\Psi\colon U^{-1}A\to T^{-1}R$.
Now map $S^{-1}A$ to $U^{-1}A$ by selecting $u\in U$ and sending $\frac{a}{s}$ to $\frac{au}{su}\in U^{-1}A$. If \frac{t}{s'}\in T, then \frac{tu}{s'u} is a unit in $U^{-1}A$, since $tu\in U$. Thus, the map factors through $T^{-1}(S^{-1}A) = T^{-1}R$, giving a map $T^{-1}R\to U^{-1}A$. Now just verify that the compositions of the maps $T^{-1}R\to U^{-1}A\to T^{-1}R$ and $U^{-1}A\to T^{-1}R\to U^{-1}A$ are the identity. $\Box$
Now, looking at your special case, note that $U$ consists precisely of all the "numerators" in $S^{-1}P$, and it is easy to see that they are precisely the elements of $P$.