Various factors contribute to the formation of ocean waves - they can be made by geological movements underwater (such as earthquakes or landslides), by the wake from ships, or, most commonly, by the wind.
The wind sweeps over the surface of the water, and the friction pulls the water into waves. Blow on some still water, and you can see this happening easily enough. The water has energy applied to it, and moves in a circular motion up the side of the wave, over the crest, and down the other side into the trough. As such, the water itself does not move very much - it is simple energy being transferred from one drop to another. This is however only true in shallow water.
As a wave reaches the shore, the circular motion of the water is interrupted by the seabed - the top of the wave, which has less friction (air rather than land), moves faster than the bottom, and thus the waves "breaks" - rearing up, forming a tunnel, and then crashing in on itself in a big foamy mass.
The violence of the breaking wave is determined by how steep the seabed is. A steep slope makes the wave break more suddenly, and with more power. If the slope is very shallow the wave may even break far off from the shore, and then spill gently in.
The size of a wave depends on three main factors - how fast the wind is (measured by the Beaufort Scale), how long the wind blows for, and how much ocean the wave has crossed. The further a wave has travelled, the more powerful it will be, so beaches facing open ocean tend to have the most powerful waves.
Some waves are so massive however that no strength of wind can create them. These are the tsunamis, and are caused by large movements of the earth underwater - earthquakes, volcanoes, and landslides. Imagine dropping a rock into water - the ripples are the smaller cousins to the tsunami.
The danger of a tsunami comes from the sheer volume of water affected. The transfer of energy from an earthquake can be immense, and last for a long time too, and as such, the wave has a massive volume of water behind it. This can be hard to spot, because although tsunamis have been known to reach as much as 120ft in height, they only do this when they reach shallower water. They then rear up to their full height, and can completely engulf entire islands. This happened to the Maldives when they were stuck by the Asian Tsunami in 2004.
Generally though waves are simply tiny ripples on the surface of the water. But isn't that the brilliance of nature? One minute it can be gentle and friendly...the next it can kill you.
But it is always beautiful.