Covalent bonds are formed as a result of the sharing of pairs of electrons between atoms in order to attain a full outer shell. This typically will happen between two non metals. An ionic bond has the same aim of getting a full outer shell of electrons, however, in an ionic bond an atom may give or loss an electron to the atom it is bonding with. The atom receiving the extra electron will become more negatively charged due to the extra electron/s and become a negative ion and the atom donating electrons will become a positive ion. The ionic bond occurs due to the electrostatic attraction between the positive and negative ions that are formed. As a result you can see that both ionic and covalent bonds happen with the same aim of attaining a full outer shell, however, the way they go about achieving this is different.