This occurs when electrons are transferred from one atom to another in a chemical reaction, producing an ionic compound.