Apart from special waves such as tsunamis, the only thing that produces the waves we see on our coasts is the action of the wind blowing over the sea surface. Waves arriving on a coast can be generated by local wind, in 'real time', in which case the waves are called windsea, or they can be the result of a wind that blew over the surface of the ocean thousands of kilometres away, up to several days before, in which case they are termed swell or groundswell.
To produce waves, the air moving over the surface of the water has to somehow transmit its energy to the water. Just how this happens is a very complicated process, still not well understood. The most accepted theory is the one proposed in the 1950s by J.W. Miles and O.M. Phillips" the Miles-Phillips theory. The theory describes how waves are generated from a flat sea using two mechanisms; the first of which produces tiny ripples called capillary waves, and the second of which produces bigger waves called gravity waves (those we ride).
According to the Miles-Phillips theory, capillary waves first begin to grow from an entirely flat sea, and then gravity waves are subsequently formed from a sea already containing capillary waves. Gravity waves and capillary waves are named as such because the restoring force (the force that returns the sea to an equilibrium position after the wind has lifted it up) is gravity in the case of a gravity wave and capillary action, or surface tension, in the case of a capillary wave.
The initial generation of capillary waves is due to perturbations in the surface wind, causing irregularities in the water surface. The wind does not blow completely horizontally all the time; it will naturally contain random disturbances that give it small vertical motions as well. Sometimes, these vertical motions are enough to create tiny up and down motions on the surface of the water itself. This is the vital beginning which triggers off further reactions and facilitates the flow of energy between wind and water.
Once the sea contains capillary waves, there is an increase in surface roughness, which allows the moving air to 'grip' the surface of the water. There is no longer any need for small vertical perturbations in the air flow; the horizontally-moving air will now push up the existing bumps in the water surface. This second mechanism is self-perpetuating; the rougher the surface the more 'grip', the more grip the bigger the waves, the bigger the waves the rougher the surface, and so on. While the first mechanism causes the waves to grow at a rate which is linear with time, the second mechanism is exponential with time; the bigger they are the quicker they grow.
The restoring force of these bigger waves is now gravity, not surface tension. Eventually a point will be reached where the wind can't lift up the surface of the sea any more" the force of gravity pulls the water back down again at the same rate as the wind lifts it up. This natural limit is reached for a given windspeed, so, if the wind gets stronger, the waves will get higher.
Where does the wind come from to generate the waves?
To produce waves big enough to surf, all you need is a reasonable strength wind blowing over a fairly decent stretch of ocean for a good few hours. It doesn't really matter where that wind comes from. In fact, it can come from a number of different phenomena; for example, a tropical cyclone where surface winds of immense strength blow around a tight centre; a long, straight zone called the trade-wind belt, just to the equator-side of a large semi-permanent high pressure; a local wind on the coast called the sea breeze which blows in the afternoon to equalize a surface pressure difference caused by hot air rising off the land, or a monsoon which is a kind of giant sea breeze. But probably the most important phenomenon for producing the waves we ride is the low pressure, sometimes called the mid-latitude depression.
A low pressure is just a cell of air on the surface whose pressure happens to be lower than its immediate surroundings. To try to equalize this pressure difference, air will try to flow from outside the low in towards the centre, in other words from high to low pressure. However, because of the rotation of the Earth, this air will tend to get steered to the right in the Northern Hemisphere and to the left in the Southern Hemisphere. As a result, the air around a centre of low pressure will end up circulating in an anticlockwise direction in the Northern Hemisphere and in a clockwise direction in the Southern Hemisphere. Note that the direction of rotation of air around a low pressure is always called cyclonic, regardless of hemisphere.
The exact way in which a low-pressure system is formed is also something that scientists are still struggling to understand. A simple explanation is as follows: They are born initially from small disturbances in the atmosphere. Given the right conditions, these small disturbances can grow into large ones. The initial perturbation must be something that causes a local drop in pressure, and one thing that can do this is the meeting of two air masses of different temperatures and (hence) pressures. The warmer (lower-pressure) air will tend to slide over the top of the colder (higher-pressure) air, producing a forced local drop in pressure at the surface. If all the conditions are right, the rising air will start to spin, sucking in more air from the outside, lowering the surface pressure further, and so on until the system grows into a full-blown mid-latitude depression.