Alternating current electrical power is produced in many ways: nuclear, oil, natural gas, solar, wind, and hydropower are all used to provide electrical power. However, with the exception of electrical power generated via photo-electric cells, all of this power is generated by one simple action: the turning of a generator. All the other various sources I listed are just different ways of making the generator rotor turn to generate electrical power.
When a wire passes through a magnetic field it generates an electrical current. This is known as the generator effect and lies at the root of all power generation except for solar photo-electric cells. When one talks about alternating current this describes electrical power where the voltage potential goes through a cycle from a high potential to a low in a set cycle.
Here in the US we run on 60 hertz or cycle alternating current which means that every second the voltage potential of the electricity goes through a full cycle sixty times a second. If one were to graph the voltage potential during a single cycle it would describe a full sine curve, starting at a reference zero, building to a maximum value on the positive axis, then passing through zero to a minimum value on the negative axis, with the exact magnitude as the positive value.
To generate alternating current it is possible to spin a magnet on an axis between its magnetic poles inside a coil of wires. As the north pole of the magnet passes in proximity to the wires around it, this provides the movement and the magnetic field necessary for generator action.
In a nutshell, that is what happens in a modern electric generator. There are a number of curlicues beyond that, of course: instead of a single set of wires around the rotating magnetic field, there are three distinct sets, to generate the three-phase alternating current that is transmitted from power plants to substations for further distribution, to name just one.
So, the question is what does one hook up to the other end of the rotor to make it spin to provide the motion necessary for generator action?
In a nuclear plant, the heat from the fission of atoms is used to heat water to make steam that will turn a turbine to spin the rotor. In a natural gas plant a gas turbine, similar to a jet engine, is used for the same purpose. A windmill uses wind power to turn the rotor of the generator.
In a hydroelectric plant the energy of the water passing through the plant is harnessed to spin a water turbine, which turns the rotor in the generator.
To think about how hydroelectric plant works it can be instructive to think about a traditional water wheel. In a traditional water wheel, the water comes through the spillway over the water wheel, where it lands on the paddles and makes the water wheel turn.
What makes this water wheel work is that the water had energy stored in it due to its height relative to the bottom of the water wheel. The water wheel harnesses this potential energy to convert it to the kinetic energy of the water wheel spinning and then lets the water continue on, just without the energy of height it had before entering the spillway.
A modern hydroelectric plant, at the most basic, it is following a similar process: The water at the top of the dam or spillway enters into a raceway, where it is allowed to fall towards the bottom. Along the way, the potential energy of the water is converted into kinetic energy the water speeds up as it falls, under the effect of gravity.
This speed is then transferred to water turbines at the base of the dam making them turn. This kinetic energy, taken from the water, is then used to turn the rotor of the generators and make alternating current electric power. And the water passes out of the dam’s spillway, having simply had the energy that of its fall used for something other than tearing up the rocks at the bottom of the fall.