Water is known as a "Universal Solvent" meaning that it has the ability to dissolve almost anything. Specifically, it is a "polar solvent" which means its has both a positive and negative pole and can attract an ionic compound like salt (NACL) which also has a positive and negative charge.
Thus it is water's ionic property has allows it to dissolve NACL.