An ionic compound is formed when an atom gains or loses electrons to achieve a stable electron configuration. Ions with opposite charges are attracted to each other, forming an ionic bond. Transition metals can form multiple stable ionic states due to their complex electron configurations. Polyatomic ions contain multiple atoms that travel together and are indicated using brackets. Covalent bonds form between non-metal atoms by sharing electrons rather than transferring them.