 Chemical bonding works because of electrostatic attraction and in all cases the charged particles that give rise to the attraction are the positively charged protons in the nuclei of atoms and the negatively charged electrons. This electrostatic attraction is tied in with the drive of atoms to achieve the energetically stable state of having a full outer shell of electrons. This is often called the noble gas configuration. So the electrons that take part in chemical bonding are the valence or outer shell electrons. The core electrons are not directly involved and we can ignore them for now. There are three types of chemical bonding, ionic, metallic and covalent bonding. What differs between them is exactly how the electrostatic attraction arises between nuclei and electrons. Ionic bonding occurs between two ions of opposite charge. Usually this is between a metal cation and a non-metal anion. The electrostatic attraction occurs between the oppositely charged ions. Metallic bonding occurs between metal atoms. These can be of the same type, as in pure copper say, or of different types, as in copper and zinc atoms mixed together to make brass. The electrostatic attraction here occurs between the nucleus of one atom and the valence electrons of many surrounding atoms. Covalent bonding occurs between two non-metal atoms. The electrostatic attraction here occurs between the nucleus of each atom and the two bonding electrons which are shared between the two atoms. So why is it that an atom being a metal or a non-metal affects how they bond? Which kind of bonding two atoms undergo when they meet is determined by the properties of the atoms themselves. We can get a simple feel for how this works by looking at their electronegativity. Recall that on the periodic table electronegativity is highest in the non-metals, with fluorine having the highest electronegativity of all, and lowest in the metals. So we've said that ionic bonds usually occur between a metal and a non-metal. This means between atoms a very different electronegativity. So when low meets high the atom with low electronegativity, that's the metal, transfers electrons to the atom with high electronegativity, the non-metal. And the result is a metal cation and a non-metal anion. Metallic bonds occur between metal atoms, atoms that both have low electronegativity. This means no atom has a strong hold on its valence electrons which can wander away from their atoms nucleus and be attracted by others. And note that when they do this they leave the atom as an ion with a full outer shell. Lastly covalent bonds occur between atoms that both have high electronegativity. That is neither atom wants to give up an electron, but they can achieve a full outer shell, a noble gas configuration, by sharing electrons.