Certain elements have special affinities for other elements. This causes them to bind together in special ways to form what?
Elements combines to each other to form compounds eg: eg: Sodium (Na) combines with Chloride (Cl) and form new compound sodium chloride (NaCl).
They do so w. r. t. certain affinity towards each other.
1. For example in case of NaCl
Sodium has 11 electrons and one electron in its outer shell (1s2, 2s2, 2p6, 3s1 ), hence it looses one electron to gain stable gas configuration and form positive ion , cation.
Na - e^-1 -------------> Na+
Smilarly Chlorine has 17 electrons with 7 electrons in outer shell ( 1s2, 2s2, 2p6, 3s2, 3p5 ), and it gains one electron to gain next noble gas configuration and form Cl- anion. This property of chlorine is called electron affinity.
Cl + e^-1 ----------------> Cl-
Hence when Sodium comes in contact of chlorine Na gives up its unwanted electron (forming Na+) to Cl and Cl gains the same electron to form Cl- anion. Hence this mutual transfering of the electron among two elements result in attractive forces which binds them together to form ionic bond which results in formation of compounds.
Like wise other bonds as:
1. Covalent bond formed by mutual sharing of electrons among two or more elements results in formation of compound eg: H2O, CCl4, CaCO3 etc.