Explanation:
An ionic bond is generally formed by a metal and a non-metal.
For example, lithium is an alkali metal with atomic number 3 and its electronic distribution is 2, 1.
And, chlorine is a non-metal with atomic number 17 and its electronic distribution is 2, 8, 7.
So, in order to complete their octet lithium needs to lose an electron and chlorine needs to gain an electron.
Hence, both of then on chemically combining together results in the formation of an ionic compound that is, lithium chloride (LiCl).
An ionic compound is formed by LiCl because lithium has donated its valence electron to the chlorine atom.
For example, [tex]O_{2}[/tex] is a covalent compound as electrons are being shared by each oxygen atom.