Holmes is suspicious of Mr. Wilson's assistant, and so he visits Wilson's shop and pretends to be seeking directions in order to make observations about the assistant's appearance. Before doing so, he "thumps vigorously" on the pavement outside with his walking stick. These actions are strange to Watson, but not unusual for Holmes's character;
"I am sure that you inquired your way merely in order that you might see him.”
“The knees of his trousers.”
“And what did you see?”
“What I expected to see.”
Holmes already has a line of question and tests prepared, but as usual, does not reveal them to Watson (or the reader) until the end of the story.
Holmes suspected that the assistant was digging a tunnel from Wilson's shop to some important location that he intended to burglarize. Tapping on the pavement was intended to test whether the tunnel emerged out of the front of the shop; if so, it would presumably create a hollow sound. The assistant's trousers were dirty, suggesting that he had been working on his knees; Holmes observed the quality of the stains and matched them to the soil nearest the local bank.