What is the science behind hydro energy of energy?

The Sun heats and evaporates water. Some of this water falls as rain and is collected behind dams. An amount of this water is released through passages in the dam and travels downhill and gains kinetic energy. The water then passes through a device such as a turbine which spins. Energy is extracted from this spinning and is used to make machines work, usually by generating electricity. Sometimes the energy is used directly as in a water wheel to run machines. So your answer is solar power, condensation to make rain, construction to build dams, engineering to develop turbines and water wheels, electrical engineering to transport electricity, and science to make everything work at the usage site.