4. Given that $a, b$ are non-zero and non-collinear vectors, let condition $M: \boldsymbol{b} \perp (\boldsymbol{a}-\boldsymbol{b})$;
condition $N$: for all $x \in \mathbf{R}$, the inequality $|\boldsymbol{a}-x \boldsymbol{b}| \geqslant$ $|\boldsymbol{a}-\boldsymbol{b}|$ always holds.
Then $M$ is ( ) of $N$.
(A) a necessary but not sufficient condition
(B) a sufficient but not necessary condition
(C) a sufficient and necessary condition
(D) neither a sufficient nor a necessary condition
4. C.

Let $\overrightarrow{O A}=\boldsymbol{a}, \overrightarrow{O B}=\boldsymbol{b}$. Then $x \boldsymbol{b}$ represents any vector collinear with $\overrightarrow{O B}$, $|\boldsymbol{a}-x \boldsymbol{b}|$ represents the distance $A C$ from point $A$ to any point $C$ on the line $O B$, and $|\boldsymbol{a}-\boldsymbol{b}|$ represents the distance from point $A$ to $B$. When $\boldsymbol{b} \perp(\boldsymbol{a}-\boldsymbol{b})$, $A B \perp O B$.

By the shortest distance between a point and a line being the perpendicular distance, $A C \geqslant A B$, i.e., for all $x \in \mathbf{R}$, the inequality $|\boldsymbol{a}-x \boldsymbol{b}| \geqslant |\boldsymbol{a}-\boldsymbol{b}|$ always holds. Conversely, if $A C \geqslant A B$ always holds, then $A C_{\text {min }} \geqslant A B$. Therefore, $A B$ must be the perpendicular distance from point $A$ to $O B$, $O B \perp A C$, i.e., $\boldsymbol{b} \perp(\boldsymbol{a}-\boldsymbol{b})$.