This is an example of Simple Harmonic Motion. In this animation, gravitational effects, drag, and friction have been removed. The trail in this animation is representative of the position vs. time graph of the spring. For the coordinates of the ball, the Y value is position, and the X value is time. You can adjust the spring constant (k) at the bottom. Notice the effect on the graph of changing this k value.