The primary functions of dams are to keep water levels constant and to provide a more efficient and steady stream for energy production. Dams are often used near rivers where water levels fluctuate wildly. The amount of energy that can be extracted from a water source depends on the height between the water source and the water turbine.
Dams are large artificial reservoirs that are commonly constructed in rivers. The dam can be operated to block water and raise the water level of the source stream, but it can also be opened to allow water to flow through down to a lower stream.