The point isn't about dams. The point is that what generates electricity in a dam is water flowing downhill. However, we don't have to do any work ourselves to get the water back uphill. Effectively it's a "perpetuum mobile" from our practical perspective. It is, in essence, a free lunch. The water evaporates due to the sun and rains down in the hills whether we take advantage of it or not.