Sodium loses its electron by ionization and sodium becomes positivey charged. Cholride ion on the other hand, is negatively charged, and this, an ionic bond is formed in between the two. Apart from this, they also have strong electrostatic attarcatiob between each other.