Instruments made for propellor driven aircraft sometimes needed the constant vibration to continue to read accurately. When much smoother jets were introduced, the instruments would stick sometimes and it was recommended to tap the gauges before trusting the reading. Gradually, better instruments were made and this practice went out of style but yeah- when you see pilots and engineers tapping the gauges they were doing it for a reason!