i love this saying. one belief of this phrase is the association that wood and trees have with good spirits. it used to be considered good luck to tap trees to let the wood spirits within know you were there. and now, we rap our knuckles on a piece of wood to stave off bad luck.
this phrase is usually used when one is already experiencing some good fortune and hope that it will continue.
i have experienced such great fortune in my life and am continually knocking on wood.