Zoom in on the curve y=x2 near the point (3,9). From far away it bends, but the closer you look the straighter it gets, until the piece you see is almost a line. The slope of that almost-line is the derivative at x=3. You can measure it with nearby points: from x=3 to x=3.1 the slope is 0.19.61−9=6.1, and from x=3 to x=3.01 it is 6.01. The slopes settle on 6, so f′(3)=6.
The definition does this with a general gap h. The quotient hf(x+h)−f(x) is the slope of the line through two points on the curve, called a secant. For x2 it simplifies to 2x+h, and as h→0 only 2x is left. That is a new function, f′(x)=2x, which gives the slope anywhere: 2 at x=1, 6 at x=3, −4 at x=−2.
The average rate of change also divides a change in output by a change in input, but across a fixed interval. For x2 from x=1 to x=3 it is 29−1=4, the slope of one secant line. That matches the derivative only at x=2, the middle of the interval, not at either end. If a problem names two separate inputs it wants the average; if it names one instant, it wants the derivative.
Think of it like this. A car's speedometer shows the derivative of its position: not the miles driven, not the trip average, but how fast the distance is growing at this moment. A reading of 50 mph does not promise 50 miles in the next hour. One difference: a speedometer never reads below zero, while a derivative goes negative when the quantity is falling.
Core idea. The derivative is the instantaneous rate of change at a single point, found as the limit of secant slopes as the two points merge.