…but don't actually understand how the function's effect changes over time
The fragment shader is run for each pixel on the surface of the polygon. When drawing the polygon, the vertices and other values output from the vertex shader are blended depending on the current position on the surface of the polygon.
For example, look at this triangle here:
This is your classic OpenGL triangle. One of the first things you draw when learning OpenGL.
Each vertex in the triangle has a different color. When the triangle is drawn, the three colors are blended depending on the position of the current pixel inside the polygon: more red the closer to the red point, more green the closer to the green point, etc. Half way between the red and green points, red and green are blended 50/50, giving orange. In the absolute center of the triangle, all three colors are blended equally, each contributing 1/3 of the final color.
The coordinate system used to determine how to blend the values is called Barycentric Coordinates. For more information look here:
http://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-rendering-a-triangle/barycentric-coordinates