Fact 1: a generator converts kinetic energy into electrical energy. 
Fact 2: Water behind a dam has potential energy that can be converted to kinetic energy.
a generator is used to turn water behind a dam into electrical energy.