Water spins a generator which transports electricity to a power house which powers the dam. Here’s a picture.
First the water goes through the intake.Then through the penstock the penstock is a sort of a tube which leads to the turbine. The turbine spins and spins and spins at the top of the turbine there is a generator. above that there is a powerhouse. the powerhouse holds the power