I can prove that $X^a - 1 \mid X^b - 1$ if $a\mid b$, and even that the integer division of $a$ by $b$ translates in some sense into a division of $X^a$ by $X^b$. However, I do not know how to deduce $$\gcd(X^a-1, X^b-1) = X^{\gcd(a,b)}-1$$
I would like to know both formally why it can be proved, but also if there is something deeper to be understood (e.g. if there is a hidden notion of "morphism preserving the integer division" or so)