Let's look at the concrete example, to see what is going on, and assume we are not in characteristic $2$.
Then, using the normal quadratic formula if $$x^4-10x^2+1=0$$ then $$x^2=\frac {10\pm \sqrt{100-4}}{2}=5\pm 2\sqrt 6$$ and if $6$ has a square root in your finite field, then the original equation is reducible.
The roots in a splitting field are $\pm \sqrt 2\pm \sqrt 3$ and the factorisation already obtained corresponds to one pairing of the roots: $$(x^2-5-2\sqrt 6)(x^2-5+2\sqrt 6)=$$$$=(x-\sqrt 2-\sqrt 3)(x+\sqrt 2+\sqrt 3)\cdot(x+\sqrt 2-\sqrt 3)(x-\sqrt 2+\sqrt 3)$$
If we were instead to choose other pairings we'd get $$(x-\sqrt 2+\sqrt 3)(x+\sqrt 2+\sqrt 3)\cdot(x-\sqrt 2-\sqrt 3)(x+\sqrt 2-\sqrt 3)=$$$$=(x^2+2\sqrt 3 x+1)(x^2-2\sqrt 3x+1)$$ or $$(x-\sqrt 2+\sqrt 3)(x-\sqrt 2-\sqrt 3)\cdot(x+\sqrt 2-\sqrt 3)(x+\sqrt 2+\sqrt 3)=$$$$=(x^2-2\sqrt 2 x-1)(x^2+2\sqrt 2x-1)$$ and these give factorisations in the case that $\sqrt 3$ or $\sqrt 2$ exist in your finite field - ie that $3$ or $2$ are squares.
Now, you may also know that the product of two non quadratic residues modulo $p$ is a quadratic residue. From this it is easy to deduce that at least one of $2,3, 6$ has a square root in a field of characteristic $p$. So the polynomial is reducible. If two of the three have roots then the third does and the polynomial splits into linear factors.
Modulo $5$ we have that $6$ is a square while $2$ and $3$ are not. Modulo $7$ we have that $2$ is a square while $3$ and $6$ are not. Modulo $11$ we have that $3$ is a square and $2$ and $6$ are not. Modulo $23$ we have that $2, 3, 6$ are all squares. So all four possibilities occur.
Finally it is easy to show that in characteristic $2$ we have $x^4-10x+1=x^4+1=(x+1)^4$.
So I've worked this in some detail in case it helps you to see what is going on. You can generalise to $a$ and $b$. Obviously there are more efficient expositions, but sometimes longhand helps.