Knocking on wood three times is supposed to keep your luck from turning bad. This superstition was traced to ancient times when people believed gods lived in trees. People believed gods lived in trees.
People believed they were touching magic when they torched wood.