Given NaCl is an ionic compound. How is an ionic bond formed in NaCl?

Given NaCl is an ionic compound. How is an ionic bond formed in NaCl?