Ionic and covalent bonds differ in the degree of bonding electrons sharing.
When two atoms bond, they essentially share bonding electrons with each other.
If both atoms have the same electronegativity, then the bonding electrons will spend an equal amount of time surrounding each of the two atoms.
This is what a covalent bond actually is - an equal sharing of bonding electrons between two atoms.
If one of the two atoms is more electronegative than the other, it will attract the bonding electrons more. This implies that the bonding electrons will spend more time surrounding the more electronegative atom and less time surrounding the less electronegative atom.
This will create partial positive and partial negative charges on the two atoms. The atom that gets the bonding electrons more will have a partial negative charge, while the other atom will have a partial positive charge.
When this happens, a polar covalent bond is said to exist between the two atoms. In a polar covalent bond you have unequal sharing of the bonding electrons.
Now, if the difference in electronegativity is significant enough, the bonding electrons will spend most of the time surrounding the more electronegative atom.
This will weaken the bond between the two atoms significantly. However, because the partial positive and partial negative charges become significant in magnitude, an electrostatic attarction will keep the two atoms bonded together.
In this case, you can say that the more electronegative atom becomes an anion, or negative ion, and the less electronegative atom becomes a cation, or positive ion.
This is what an ionic bond actually is - the electrostatic attraction between a positive ion and a negative ion.
It's very important to remember that no bonds are completely ionic or completely covalent (excluding here the bonds between two identical atoms like
Every bond will have some ionic character and some covalent character.
As the electronegativity difference between two atoms decreases, you go from predominatly ionic, to predominantly polar covalent, to non-polar covalent bonds.