We were eating at a restaurant with some Chinese friends and one of them asked the waitress to refill his tea cup. When she finished pouring the tea, he didn't say "thank you," but instead knocked two knuckles on the table. Bryan asked him why knocking on the table meant "thank you" and our friend told us this story:
China was ruled by emperors for several thousand years. One emperor decided to travel around his empire and see for himself how the country and its citizens were doing. This was actually hard to do, however, because he had hundreds of people accompanying him everywhere and everyone prepared their best for his arrival. Therefore, the emperor decided to travel incognito with only two trusted aides, so that he could move about freely without being recognized.
One evening during their journey, the emperor and his aides were eating dinner at a local restaurant. The aides were very nervous about eating at the same table as the emperor, because this was never, ever done. But the emperor insisted that they eat together to maintain his disguise.
When the tea arrived, the emperor did something that stunned his aides; he lifted the teapot and personally served tea to them. His aides wanted to fall to their knees and kow-tow to the emperor, which they normally would have done at the palace, but that would have blown their disguises. So instead, they each balled up their right hands into a fist, stuck out their index finger and third fingers like a pair of legs, and bent them at the first knuckle, like knees. They then tapped the "knees" on the table to signify their kow-towing! This way, they could respect their emperor without giving away his identity.
So now, if someone pours tea, beer, water, etc. for you, you can also show your thanks by tapping your knuckle "knees" on the table.
(selected from 101 Stories for Foreigners to Understand Chinese People by Yi S. Ellis and Bryan D. Ellis, published by China Intercontinental Press in 2012)