When the tide rises, the floodgates open and let the water until it reaches its maximum level. Then the dam is closed to hold it and wait for the sea go down the other side, producing a large gap. This height is exploited for passing the water through the turbines and generate electricity.