There are 3 main factors that contribute to and cause the formation of waves.
The first is wind. Wind out at sea has little resistance since there are no large landmasses above water and thus no buildings or mountains to obstruct it. Therefore the wind can whip up the water and push on it causing displacement which causes the water to rise up in spots making waves.
The second cause would be gravity. As the earth rotates and spins the water which is not stationary gets pulled by gravity which can sometimes oppose the direction the earth is spinning. This explains high and low tide. As the earth is spinning, gravity is pulling water down to earth and the opposite forces cause the water to recede or come up to land. Some research also indicates the the gravitational pull of the moon, while not strong enough to pull the earth, has enough pull to counteract earth's gravity on water enough to cause water displacement and thus waves.
The third and generally the cause of the most violent waves including tsunamis are earthquakes caused by the shifting of the tectonic plates under the ocean. Minor earthquakes can cause waves that travel for miles to shore while earthquakes caused by one plate shifting up on top of another slightly can cause hundred foot high waves called tsunamis that can travel miles with great speed and power from the origin of the plate shifting.
One can see how waves are formed by wind by placing water in a large bowl then blowing gently in one direction on the waters surface causing ripples. To see how plate shifting can cause waves, fill a bathtub and submerge your hands under the water. Move your hands back and forth while open creating a paddle under the water and you'll begin to see water disturbance associated with earthquakes (although on a much smaller scale of course).