fix a field $F$ and consider an $n \times n$ matrix $M(X)$ with entries in $F[X]$. the determinant $\det(M(X))$ is itself a polynomial, say $D(X)$.
clearly, if $x \in F$ is such that the specialized $\text{rank}(M(x)) < n$, then $D(x) = 0$. i want to say more:
Claim. If $x \in F$ is such that $\text{rank}(M(x)) \leq n - d$, then $D(x)$ vanishes to order $\geq d$; that is, $(X - x)^d \mid D(X)$ in $F[X]$.