Single-variable calculus from first principles
To find the peaks and valleys of a function (its maxima and minima) you hunt for the flat spots. At the top of a hill or the bottom of a valley, the tangent line is horizontal, so the slope is zero. Those are the critical points.
Setting f′(x) = 0 and solving gives the candidate locations. This is a necessary condition for a smooth peak or valley, but not quite sufficient, since a flat spot could also be a momentary pause (a saddle-like inflection). You confirm what kind it is with a test.
Picture a hike across rolling hills. As you climb toward a hilltop the ground tilts up under your boots; as you head down into a valley it tilts the other way. Right at the very top of a hilltop, or the lowest point of a valley bottom, the ground is momentarily flat, the slope is zero. Those flat spots are exactly the critical points you hunt for.