Positive charges attract negative charges. Table salt is NaCl , a combination of sodium and chloride ions.
Sodium ions are positive, and chloride ions are negative, that's why they stick together as salt.
Table salt dissolves in water. When it does, the Na and Cl ions separate somewhat so that there are positive and negative charges in the solution. That's why salty water is a good conductor of electricity. There are many other salts in nature. The property of all salts is that when dissolved in water they separate into positively and negatively charged ions with water molecules attached.