Dams are constructed at heights to obstruct the flow of water and store it. The stored water has Potential Energy.
Water stored in heights now is allowed to flow to low levels. The potential energy is converted to kinetic energy and moves the turbines.
Electricity is produced.
This is called Hydroelectricity because the potential energy of water which is stored at elevated heights is converted into kinetic energy of flowing water which in turn is converted electricity
It is a renewable source of energy, since rainfall comes over and over again.
Most of the electricity in India is generated in this method. Since there are not many natural waterfalls, dams are constructed to store water at heights and then allowed to fall and this energy is used to move turbines and thereby generate electricity.