Here's why:
* Copper (Cu) is a metal, and metals tend to lose electrons to form positively charged ions (cations).
* Sulfur (S) is a nonmetal, and nonmetals tend to gain electrons to form negatively charged ions (anions).
In a compound like copper sulfide (CuS), copper loses one or two electrons to become a Cu⁺ or Cu²⁺ ion. Sulfur gains two electrons to become a S²⁻ ion. The opposite charges of the ions attract each other, creating an electrostatic force that holds the ions together in a lattice structure. This electrostatic force is what we call an ionic bond.