ionic compounds are formed by ionic bonds through mutual electrostatic forces of attraction between ions of opposite charge(positively. negative)
electrostatic force is the attraction or repulsion of positive and negative charges like magnetic force
ionic compounds are held together by strong electrostatic forces of attraction between oppositely charged ions of cations(metal ions) and anions(non-metal ion)