Spectator ions are dissolved ions present in double replacement reactions which produce a precipitate that are not part of the precipitate.
Consider the example reaction below:
NaCl(aq) + #AgNO_3#(aq) -> AgCl(s) + #NaNO_3#(aq)
When aqueous solutions of NaCl and #AgNO_3# are combined there are actually four different ions moving around in the water. They are Na+, Cl-, Ag+ and #NO_3#- ions. When the Ag+ and Cl- ions collide, they will form an ionic bond which causes them to clump together and form a precipitate.
The Na+ and #NO_3#- ions are present in the container where the reaction is occurring, but they are not part of the solid product which precipitates. They are called spectator ions because they are present but only "watching" as the precipitate forms.