The red boxes indicate keyframes, the dotted line shows the interpolated trajectory.
For example, if you have an object representing an elevator that has not been animated, no keyframes (or keys) exist for it. If you turn on the button, move to frame 20, and move the elevator along the Z axis to the second floor, Position keys are created at frames 0 and 20. The key at frame 0 represents the position of the elevator before it was moved, while the key at frame 20 represents the position of the elevator after it was moved along the Z axis. When you play the animation, the elevator moves from the ground floor to the second floor over 20 frames.