In this simulation, 17 balls are programmed to oscillate at angular frequencies of ω, 17ω/16, 18ω/16, 19ω/16,… 2ω. Notice that the angular frequencies are evenly spaced out, which implies the periods are not.
Since angular frequency is the rate of change of phase angle, the leftmost ball lags behind the most in terms of phase. For example, after one period of the leftmost ball, the leftmost ball would have progressed by only one cycle (2π), while the rightmost would have already progressed by two cycles (4π), and the other balls evenly spaced out in between. This makes the balls line up along one cycle of cosine function.
After two periods, the positions of the balls would be spaced out evenly along two cosine functions. (Because the rightmost ball would have completed 2 cycles more than the leftmost).