If one rearranges the ideal gas law equation, you can obtain the following (assuming $n$ and $T$ are non-zero):
$$\frac{PV}{nT} = R$$
$R$ is a constant, and there are in fact infinitely many possible sets of values $(P, V, n, T)$ that satisfy the equation. Let $(P_1, V_1, n_1, T_1)$ denote one such set, and let $(P_2, V_2, n_2, T_2)$ denote a second one. Then, we have:
$$\frac{P_1V_1}{n_1T_1} = R$$
$$\frac{P_2V_2}{n_2T_2} = R$$
So, by the transitive property:
$$\frac{P_1V_1}{n_1T_1} = \frac{P_2V_2}{n_2T_2}$$
You can let $n$ and $T$ be constant as well (as in your specific example), but the principal is the same and leads to an analogous result, since any product and/or ratio of constants will itself be a constant.