NaCl is an ionic compound. As an ionic compound, it possesses a crystal-lattice structure with countless ions of opposite charge that are electrically bound to each other. Ionic bonding consists of one elemental ion donating an electron to another ion that lost an electron, and binding together as a result.
The difference between an ionic bond and a covalent bond is that the former requires an electron acceptor and an electron donor. In a covalent bond, the atoms are equally attracted to each other because of their shared electronegativity. Neither member of the pair has lost or gained an electron.