In AgCl, each silver atom loses one valence electron to become a positively charged silver ion (Ag+), while each chlorine atom gains the electron to become a negatively charged chloride ion (Cl-).
Thus, the overall bonding in AgCl is driven by the electrostatic attraction between the positively charged silver ions and the negatively charged chloride ions, resulting in the formation of a stable ionic compound. The strong electrostatic forces between the ions hold the crystal lattice of AgCl together.