It is a superstition. You "knock on wood" that what you just said doesn't really happen. Example....if you were to say..."I'll probably get into an accident on the way home"....you then "knock on wood" that it doesn't happen. When no wood is immediately available I always knock on my head.....