(4) Given that $\vec{a}$ and $\vec{b}$ are non-zero and non-collinear vectors, let condition $M: \vec{b} \perp (\vec{a}-\vec{b})$;
condition $N$: for all $x \in \mathbf{R}$, the inequality $|\vec{a}-x \vec{b}| \geqslant |\vec{a}-\vec{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) Let $\overrightarrow{O A}=\vec{a}, \overrightarrow{O B}=\vec{b}$, then $x \vec{b}$ represents any vector collinear with $\overrightarrow{O B}$, $|\vec{a}-x \vec{b}|$ represents the distance $A C$ from point $A$ to any point $C$ on the line $O B$, and $|\vec{a}-\vec{b}|$ represents the distance from point $A$ to point $B$. When $\vec{b} \perp(\vec{a}-\vec{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 $|\vec{a}-x \vec{b}| \geqslant|\vec{a}-\vec{b}|$ always holds. Conversely, if $A C \geqslant A B$ always holds, then $(A C)_{\text {min }} \geqslant A B$, so $A B$ must be the perpendicular distance from point $A$ to $O B$, $O B \perp A C$, i.e., $\vec{b} \perp(\vec{a}-\vec{b})$. Therefore, the answer is C.