The second function of the dam is to provide electricity. The dammed water drives a water turbine and generator. It still works today. This technology (hydroelectricity) had been invented in the 19th century in England and Germany, and was by 1900 used in the USA and most European countries.