The atoms reach maximum stability when they achieve completion of their "s" and "p" outer shells. Had they few electrons in the outer shell, they would give away those surplus electrons. If in turn they miss a closed shell by a few electrons, they would accept the necessary ones from another atom.
Accepting or releasing electrons, that's the question.
However, the normal situation is that of sharing electrons.
CARBON is the master element in the art of sharing electrons!!!