Detailed Instructions: Given a scientific question, generate a correct answer to it.
Problem:Ionic compound atoms of various elements gain or lose electrons to?
Solution:
produce ions