What is electrolysis and how does it apply to water and salt?

Electrolysis is the use of an electric current to facilitate the decomposition of a compound. Water is decomposed by electrolysis into $\text{O"_2}$ and $\text{H"_2}$. Molten sodium chloride is also decomposed by electrolysis into $\text{Na}$ and $\text{Cl"_2}$.