The notes I read gives following technique to factor an ideal in a number field without explanation. Can anyone explain how this technique works?
To factor the ideal $(2)$ in $\mathbb{Z}[\sqrt{-5}]$, the idea is to factor $x^2+5$ mod $2$. The result is $x^2+5 \equiv (x+1)^2$ mod $2$. Identify $x$ with $\sqrt{-5}$, then we get $P=(2,1+\sqrt{-5})$. Then $(2)=P^2$.
Why this technique works for all $\mathbb{Z}[\alpha]$ if the number field is $\mathbb{Q}[\alpha]$?