Prerequisite concepts
Multivariable Calculus
The derivative is a local quantity
The value of the derivative does not depend on what is happening far away from the point at which the derivative is being evaluated: it can be determined by what is happening in the neighborhood of the point. Geometrically, the derivative (slope) of a curve at a point is not a statement about the general shape of the curve but rather about the behavior of the curve immediately around that point.
The gradient is a local quantity
The magnitude and direction of the gradient depends on the behavior of the function infinitesimally near the point of interest. One implication of this is that the gradient does not point in the direction of maxima a finite distance away (except sometimes accidentally), but rather in the direction of steepest slope at the point of interest.