I was just wondering if there's an intuitive reason why for the Miller-Rabin primality test, we check whether $b^t \equiv 1 \pmod n$ oror $b^{2^{j}t} \equiv -1 \pmod n$ for some j with $0 \leq j \leq s-1$, where $s$ is a nonnegative integer, $t$ is an odd positive integer, and n is an integer.
Most links seem to just use as is, and doesn't mention why. I see how if we have $b^{n-1} \equiv 1 \pmod n$ we can take it's square root, but I don't see why $b^t \equiv 1 \pmod n$ and $b^{2^{j}t} \equiv -1 \pmod n$ are the conditions for passing the test.
If the conditions do not hold, you get a nontrivial congruence x^2=1 (mod n), which immediately leads to a fatorization.