Every local extremum in the interior of the domain of a differentiable function is neccesarily a critical point, i.e. $f'(x)=0$ is a necessary condition for $x$ to be a local extremum. There are critical points which are not local extrema.
Note that I'm stressing local extremum in the interior here. To account for global extrema, one needs to consider the behavior on the boundary of the domain as well.
Consider the function $$f:[-1,1]\rightarrow \mathbb R, x\mapsto x^2.$$ $x_0=0$ is a critical point and indeed a local extremum (a minimum). For the global extrema note that $x^2 \leq 1$ for $x\in [-1,1]$ so that $f(1)=f(-1)=1$ and $x_1=1, x_2=-1$ are points where $f$ attains a (global) maximum, but they are not critical points.
Similarly, for $$f:[-1,1]\rightarrow \mathbb R, x\mapsto x^3.$$ $x_0=0$ is a critical point, but there's no extremum. Maximum and Minimum are attained at $x_1=1$ and $x_2=-1$, neither of which are critical points.