Ocean waves have a primary and two secondary causes, depending on the type of wave we are talking about. The primary cause also has a direct and an indirect cause. Addressing the direct cause without doing the same to the indirect cause comes short of giving the whole picture.
Because the Earth is tilted at 23.5 degrees, the equator gets much more sunlight than the poles, and the rays are nearly directly overhead. At the poles, alternately for 6 months at a time, sunshine is weak or nonexistent, and it comes in from an angle, stronger and more direct in the polar summer, and weaker and less direct in the polar winter.
This produces uneven heating of the earth's surface. This is the indirect cause of waves, but more explanation is needed to best understand this.
Cold air is denser than warm air, so cold air falls and warm air rises. In making this vertical movement, winds are created as warm air moves toward the poles and cold air moves toward the equator. Because of the spin of the earth, the winds move at an angle, rather than directly North and South. It is the wind that is the direct cause of the waves, as we will see shortly.
Wind flowing across water causes ripples. Most people have seen this phenomenon on lakes and even swimming pools. Ripples are nothing more than shallow waves.
In the ocean, though, the ripples can gather together, creating what we more normally think of as waves and swells, especially in the presence of strong air flows like the winds around storms. What we see on a beach as the breaking waves is a result of the water being piled up by the force of the winds. The strength of the winds, how far they've traveled, and the depth of the water at the point that they crest determines the height of the wave.
There are two main kinds of secondary waves, too. One of these is when there is an earthquake, underwater landslide, or volcano that very suddenly displaces a large amount of water. The water rushes in, then rebounds, creating a wave that originates far below the surface of the water. The waves that are produced can move at astonishing speeds of over 500 mph (800 km/hr). They also have very long wavelengths (the distance from one wave crest to the next), so that the crests can be 15 minutes apart even at the great wave speed.
When these waves reach shallow water, the part of the wave at the ocean floor slows down due to friction against the sand and rock, while the top of it continues moving at high speed. This forces the water to even higher crests as water builds up behind the wave, until they finally break, in the form of a tsunami. Tsunamis can measure hundreds of feet high (tens of meters high).
The second sort of secondary wave is called a climatological wave, and this occurs when a storm at sea causes the water to bunch up in front of the storm front. An example of this sort of wave is the storm surge that is common, and which causes a majority of the damage, when a hurricane strikes land.
Waves are more complex than most people think, and part of that complexity adds to the fact that there is more than one single simple cause. They can be spectacular or they can be destructive. However, by making the effort to understand them, we learn ways that our earth functions.
Next time you see an ocean wave, just think; that wave could have been generated initially, many thousands of miles away, over tropical waters.