Ocean waves are mainly generated by the action of wind on water.
The waves are formed initially by a complex process of resonance and shearing action, in which waves of differing wave height, length, period are produced and travel in various directions.
Once formed, ocean waves can travel for vast distances, spreading in area and reducing in height, but maintaining wavelength and period as shown in