# Why is factoring $p-1$ easy when $p$ is a safe prime?

A paper states:

[...] $(p,g,y)$ is a correct ElGamal public key if $g^x=y\pmod p$. To verify this the order of $g$, and thus the factorization of $p-1$, is needed. This is easy for safe primes (i.e., primes $p$ for which $\frac{p-1}2$ is prime), but may be hard otherwise [...]

Why is it easy to factorize a safe prime's predecessor?

If $p=2q+1$ is a safe prime (that is, $q$ is a prime as well), then $p-1=2q$ has exactly two prime factors: $2$ and $q=(p-1)/2$.