If an element's atom is a few electrons short of $$8$$ electrons in its outermost orbit, it tries to use electrons from another atom so that the atom now has $$8$$ electrons in its outermost orbit.
Look at Atom A and Atom B in the figure. Atom A has $$7$$ electrons in its outermost orbit, and B has $$8$$ electrons. Is B a good atom for A to take an electron from?