This is one of the most popular superstitions.
People knock on wood after boasting, making a prediction, or speaking of good fortune.
Since wood comes from trees, this belief stems from ancient tree folklore. Down through the ages people believed that trees were the homes of gods. These were kind obliging gods if approached in the right way. In asking a favor of the tree god one would touch the bark. After the favor was granted the tree was again knocked as a sign of thanks.