If electrons in an alternating current periodically reverse their direction, do they really flow? Won't they always come back to the same position?
Although the question is not clear, my guess is that you are confused with the flow of current and mean position of electrons.
In case of DC, we have a continuous flow of charge from one point to another point in the conductor, any electron completes a cycle of circuit.
In case of AC, there is no net displacement of charge and this may lead one in thinking that there should be no flow of current as mean position of charge carriers (electrons) is same.
However current is the charge passing through a cross-sectional area per second taken in the conductor, and it is not affected by the mean position of electrons (which may remain same).
Take any cross section of a conductor and charge is continuously passing through it. It is nothing but current (even though mean position of electrons is same in case of AC).
In an alternating current, do electrons flow from the source to the device?
Let's go back to DC for a second. A battery has two ends. A light bulb has two contacts. The battery won't light the light bulb unless you make a closed circuit, so yes, electrons flow from the source to the device, and they also flow back.
What makes the light bulb light is the fact that electrons are flowing through it. It doesn't care which direction they flow. You can reverse the battery and the bulb will still light.
That's all AC is - a DC source that's continually being reversed. It lights the bulb one way, and then it lights it the other way.
P.S. Think of riding a bike with toe clips. You do work on the down stroke, and you do work on the up stroke. You produce lots of power, but your feet stay attached to you.
P.P.S. The reason AC is even used, rather than DC, is with AC you can easily make transformers to change the voltage. (A transformer is like gears on your bicycle.) That way you can transmit huge amounts of power long distances on fairly slender wires, and then transform it down again to be relatively safe for consumers to use.
(Thomas Edison and George Westinghouse had a huge battle over this, and Westinghouse won. Years later, Edison remarked to Westinghouse's son "By the way, your old man was right".)
In electromagnetism, and therefore in any image of how nature works, there are two frameworks.
1) The classical where we have fields, currents, waves, voltages, etc.
2) The quantum mechanical, where we have electrons, protons, ions, photons, etc.
The question mixes the two frameworks and inevitably paradoxical questions arise.
The two frameworks are connected, but one has to be aware that there are two different ways to view matter, the second, quantum mechanical, more fundamental, from which the classical fields are built up.
One can make a classical form of the electric current as the number of electrons, time, velocity, etc, and with the appropriate constants the system works and is consistent. But this classical picture breaks down when one tries to localize electrons.
Electrons in an electron gun in a vacuum tube form a current and the classical current picture coincides with the quantum mechanical. But in solids the microscopic configuration is much more complicated.
In metals, the electrons are quantum mechanically occupying a level, a conduction band, where they have a collective behavior that gives the combined classical current, but individual electrons do not have a "position" from which to move. They follow closely (continuous) spaced energy levels which they occupy with zillion other identical electrons, the notion of position is irrelevant.
In crystals, like transistors and semiconductors, electrons migrate from energy level to energy level of the crystal according to the energy supplied, and the energy levels available, but again one electron is indistinguishable from another in a collective field (as the link above should demonstrate to you). The current behavior is a collective one and the position of individual electrons do not enter it in a one-to-one correspondence way. Only a collective current can be defined and "position of an electron" is not available in that definition; unless one sets up a very detailed experiment in order to probe the quantum nature of the phenomenon. We then will be speaking of individual electrons, not currents, though they can be formally defined.
All in all, for general purposes, the classical framework is sufficient.
I think Ron's comment is very fitting and I want to add a simple fluid analogy.
Your AC source is indeed creating an oscillation in the position of the electrons over time. This has several advantages from an engineering standpoint as you can use generators, electric motors and transformers easily with an oscillating current.
The fluid analogy would be a pump that consists of a piston moving left and right which creates an oscillation in the movement of water molecules. Now you add a ratchet to this this circuit and you can use the oscillating water molecules to provide mechanical work.
Here is simple analogy. Find a pole and put 10 meter long piece of fabric around it. Go 5 m away from the pole. Start pulling left and right end of the fabric. As you are pulling fabric it is rubbing pole, the friction between fabric and the pole heats pole. Fabric does not go anyway, it just moves left and right and still it makes work.
In the same way electrons don't go anyway, they are moving left and right and by "rubbing" against material, they heat it, or they make other useful kinds of work.
The best best analogy to explain this is the pipe/tube filled with balls.
- Imagine a tube with a diameter big enough to only accept a single golf ball.
- Now, fill a 1m tube end-to-end with golf balls.
- The golf balls are your "charge". This will be a collection of electrons.
- Get a "source" of electron charge i.e. little box of golf balls.
- Create a "ground" or "sink" to collect charge i.e. little collector box for the golf balls.
- Hold the "collector" under the tube at one end.
- Take a ball from the "source" box and push it into the tube.
- Almost instantaneously a golf ball will be pushed from the opposite end into the collector.
This demonstrates the principle of electron drift. It is certainly not at "the speed of light", possibly closer to the speed of sound! However, the net effect is almost instantaneous as described. The ball entering from the "source" side transfers its energy to the next ball; and that to the next, and so on, till the ball nearest the collector is pushed out. This happens instantly as the ball is pushed in!
This happens if there exists a "source" of charge and a "collector" of charge i.e. ground / mass of earth etc. Using the tube of balls analogy, it does not matter where you position the "source", so long as the other end has the "collector" to catch the balls. Swapping (alternating) the position of these still results in a ball being displaced from the tube and another replacing it.
At no time does the tube become depleted of balls. Similarly, a wire will not become depleted of electrons i.e. no net change. This illustrates the concept of current flow in alternating directions while answering your question regarding the net effect within the conductor.