The concept of this demo is quite simple. Although the waves look smooth, they are actually made of hundreds of segments. The RESOLUTION value controls the amount of segments.
Each wave segment has its own speed and height that is affected by the segments either side of it.
To take this demo a step further, you could try to add proper splashes. This wave feature is very useful for simulating water without using particles.