explain the differences between the formation of ionic bonds and the formation of covalent bonds