NaLi is composed of sodium (Na) and lithium (Li) atoms. Sodium is a metal and lithium is a metal. Metals and non-metals react to form ionic compounds. In an ionic compound, the metal atoms lose electrons to the non-metal atoms, resulting in the formation of positively charged metal ions and negatively charged non-metal ions. The electrostatic attraction between the positive and negative ions holds the ionic compound together.
In NaLi, sodium atoms lose one electron each to lithium atoms, resulting in the formation of Na+ ions and Li- ions. The Na+ and Li- ions are then electrostatically attracted to each other, forming the ionic compound NaLi.