Dissolution of NaCl is a two step process.The 1st step involving dissociation of NaCl into ionsrequires, called lattice energy but the 2nd step involves hydration of `Na^(+)` and`Cl^(-)` ions in which energy is released called hydration energy. Thus, overall process is accompanied by release of energy. Hence NaCl dissolves in water.