Generally speaking, waves occur when something has been moved away from an equilibrium position, then some kind of restoring force makes it returns to the equilibrium position, but its inertia makes it overshoot the center and it swings too far in the opposite direction, then it returns toward the center, but overshoots the center again, etc., etc. If this pattern moves along a line and travels, we get a wave.