Electricity flows in two ways: either in analternating current (AC) or in a direct current (DC). Electricity or "current" is nothing but the movement of electrons through a conductor, like a wire. The difference between AC and DC lies in the direction in which the electrons flow. In DC, the electrons flow steadily in a single direction, or "forward." In AC, electrons keep switching directions, sometimes going "forward" and then going "backward."
Alternating current is the best way to transmit electricity over large distances.
Origins of AC and DC current
A magnetic field near a wire causes electrons to flow in a single direction along the wire, because they are repelled by the negative side of a magnet and attracted toward the positive side. This is how DC power from a battery was born, primarily attributed to Thomas Edison's work.
AC generators gradually replaced Edison's DC battery system because AC is safer to transfer over the longer city distances and can provide more power. Instead of applying the magnetism along the wire steadily, scientist Nikola Tesla used a rotating magnet. When the magnet was oriented in one direction, the electrons flowed towards the positive, but when the magnet's orientation was flipped, the electrons turned as well.
Video comparing Alternating and Direct Current
Use of transformers with Alternating Current
Another difference between AC and DC involves the amount of energy it can carry. Each battery is designed to produce only one voltage, and that voltage of DC cannot travel very far until it begins to lose energy. But AC's voltage from a generator, in a power plant, can be bumped up or down in strength by another mechanism called a transformer. Transformers are located on the electrical pole on the street, not at the power plant. They change very high voltage into a lower voltage appropriate for your home appliances, like lamps and refrigerators.
Storage and conversion from AC to DC and vice versa
AC can even be changed to DC by an adaptor that you might use to power the battery on your laptop. DC can be "bumped" up or down, it is just a little more difficult. Inverters change DC to AC. For example, for your car an inverter would change the 12 volt DC to 120 Volt AC to run a small device. While DC can be stored in batteries, you cannot store AC.