These are between metals and non-metals. A metal has to lose electrons to fulfil the octate rule, and a non-metal must gain electrons. Hence, the metal loses an electron, which is gained by the non-metals. This causes the metal to become a cation, and the non-metal an anion. Then, due to electrostatic attraction between opposing forces, they form a bond.