In order to produce hydroelectric power, they pump water up to the top of a mountain, and as gravity causes the water flow down again, it is used to turn the turbines. If it requires an input of energy to pump water up the mountain, why do they use this process?

please help me!​