To start, electricity is the flow of charged particles. Typically, it’s the flow of electrons through a wire that we think of, but any charged particles will do. To make the electrons flow, you have to give them some extra energy that will push them from where they are to where you want them to go. This is called the Electromotive Force (EMF) or more frequently Voltage.
This can be done in a number of ways, but typically this is done by spinning a magnet in a coil of wire. As the magnet spins, it physically pushes electrons away from it. This imparts them with additional energy, and (like all things in the universe), they tend to move toward a lower energy position. Balls roll downhill. Hot things cool off. And high energy electrons flow toward a place where they can have less energy. This voltage is also called a potential difference since the electrons have more potential energy where they are than they will when they get where they’re going.
You can envision this like pushing electrons to the top of a slide. At the top, they slide down!
that’s a quick overview of voltage. But how do the electrons flow? Well, in a wire, the process is (relatively) simple. The atoms in a wire are surrounded by electrons (all atoms are). This is called an electron cloud. The atoms in a metal are so close together that their clouds can overlap. This allows electrons to push into the clouds of adjacent atoms. This, in turn, pushes electrons in adjacent atoms to move further along the wire. The electrons cascade through the wire and come out the other side, just like water in a pipe. This is where the term electrical current comes from.
But in water, the process is different. Water molecules do not have the overlapping electron clouds that would be necessary to allow electricity to flow easily. This is why pure water is not a very good conductor of electricity. In order to get electricity to flow through water, you have to give the electrons so much energy that they physically break the water molecules - this process creates ions (charged parts of water molecules, in this case) that can then flow through the water to the other side of the container (where the energy state is lower).
However, this is dangerous - it produces hydrogen gas (which is explosive and combustible) and oxygen gas (which will burn that hydrogen quite well). Don’t believe me:
Right. So, there’s a better way -add ions. If you add a little salt to the water (which is an ionic compound), the ions will migrate around in solution and carry the electrical current for you.
This is why electrical devices near the bathtub are so dangerous. Water itself is a pretty terrible conductor of electricity. But the minute you get into the tub, that water isn’t water anymore - it’s salt water thanks to the salt that’s omnipresent on your skin.
And saltwater is a pretty good conductor of electricity. This provides a pathway through the water, potentially through you, and into the low-energy position (probably the drain). As the electricity flows through you, it can stop your heart.
So there you have it - avery basic overview of how electricity flows through water. It’s far more complex than I’m letting on, but you now have the big picture.