Consider the expressions as polynomials in $u$.
Then $u^{pq}-1$ is a multiple of both $u^p-1$ and $u^q-1$ and so is a multiple of their lcm:
$$
u^{pq}-1
=f(u)\operatorname{lcm}(u^p-1,u^q-1)
$$
Since $\gcd(u^p-1,u^q-1)=u-1$, we get
$$
\operatorname{lcm}(u^p-1,u^q-1)=\frac{(u^p-1)(u^q-1)}{u-1}
$$
and so
$$
u^{pq}-1
=f(u)\operatorname{lcm}(u^p-1,u^q-1)
=\frac{f(u)(u^p-1)(u^q-1)}{u-1}
$$
This argument only needs that $\gcd(p,q)=1$, not that $p,q$ are primes.
More generally, if $m=\operatorname{lcm}(p,q)$ and $d=\gcd(p,q)$, then
$$
\frac{u^m-1}{(u^p-1)(u^q-1)} = \frac{f(u)}{u^d-1}
$$
since $\gcd(u^p-1,u^q-1)=u^d-1$.