If we talk about "salt", we generally mean kitchen salt. That said, there are actually all kinds of different salts in chemistry. Salts are created when you mix an acid with a base.
In the case of kitchen salt (chemically: sodium chloride – NaCl), it comes from hydrochloric acid (chemical formula: HCl) and sodium hydroxide (NaOH). The result is kitchen salt and water.
This compound of sodium and chlorine can also be reseparated.
Separation of kitchen salt into sodium and chlorine
3 tablespoons of salt
4.5 Volt battery
Fill the jar with water, add 3 tablespoons of salt and stir until the salt has dissolved.
Now wrap the two wires separately around each of the poles of the battery, then hang the two ends in the salt solution. (Important: Don't allow the two wires to touch!)
Now, both ends of the wires will begin to bubble strongly. The electrical current is separating the kitchen salt into its two components, sodium and chlorine.
On the wire connected to the negative pole (the longer one), sodium bonds with water to create a sodium hydroxide solution.
From the positive pole (the shorter pole of the battery), yellowy-green bubbles rise up, chlorine, which partially bonds with the copper to create copper chloride. If you carefully smell the jar, you will be able to recognize that typical chlorine aroma.
When salt is dissolved in water, the bonds between the sodium and chlorine dissolve. In the process, the sodum donates the single electron in its outer shell to the chlorine, which now has 8 electrons in its outer shell, which every atom would love to have (chemists call this "noble gas configuration").
Now the sodium has one electron too few, and is positively charged, and we speak of a Na+ ion.
The chlorine, on the other hand, has one electron more and is now negatively charged, in which case we refer to a Cl- ion. (Ions are electrically charged particles).
If you now add a power source to the solution (two electrodes), the Cl - ions migrate to the positive pole and donate their electron to that pole. As a consequence, they become electrically neutral and escape this pole in the form of chlorine gas.
The Na+ ions migrate to the negative pole, where they receive an electron, producing metallic sodium. This immediately reacts with the water to produce the sodium hydroxide, with hydrogen escaping.