An element’s reactivity depends on how its electrons are arranged. Electrons orbit the atom’s nucleus in layers called shells, with each shell holding up to a certain number of electrons.
If an atom’s outermost shell is full, it is less inclined to shed or gain an electron from another atom, making it very stable. Conversely, if the outer shell is occupied by just one solitary electron (ie sodium) this electron can readily be shared with another atom, making it highly reactive.
Similarly, if the outer shell is just one electron short of being full (ie chlorine) it will tend to ‘borrow’ an electron from another atom.
Main image courtesy of Jan Mehlich under GFDL and Creative Commons Attribution ShareAlike 2.5
Question originally answered by Alexandra Franklin-Cheung in issue 104 of How It Works