The answer to your question can be found in detail in the last few pages of the story. It is characteristic of many of Sir Arthur Conan Doyle's stories about Sherlock Holmes that the master detective explains his solutions to the mysteries at the end, when he and his friend Dr. Watson are back in Baker Street. The following excerpt from "The Red-Headed League" is illustrative of the conclusions of many of the Sherlock Holmes tales.
"You see, Watson," he exclaimed in the early hours of the morning as we sat over a glass of whisky and soda in Baker Street, "it was perfectly obvious from the first that the only possible object of this rather fantastic business of the advertisement of the League, and the copying of the 'Encyclopaedia,' must be to get this not over-bright pawnbroker out of the way for a number of hours every day."
Holmes goes on to explain how he guessed what the motive was. He thought about the assistant's practice of going down to the cellar on the pretext of developing photographs and guessed that he must be digging a tunnel. When he stopped by the pawnshop on the pretext of asking for directions, he noted that John Clay's trousers were "worn, wrinkled, and stained." This proved to Holmes that his guess was correct.
When he examined the neighborhood he noted that there was a branch of the City and Suburban Bank close by. He made inquiries and learned that there was a big shipment of French gold coins being temporarily stored in the basement of the bank.
"Well, when they closed their League offices that was a sign that they cared no longer about Mr. Jabez Wilson's presence--in other words, that they had completed their tunnel."
Holmes knew the burglars would have to act quickly because the bullion might be moved elsewhere. He expected them to make their move on that Saturday night because that would give them all day Sunday to make their getaway. (It would have been too bad for Jabez Wilson if he had happened to drop by his shop unexpectedly. Clay would have had no hesitation about murdering him.)
At the conclusion of Holmes' monologue, Watson exclaims:
"You reasoned it out beautifully. . . . It is so long a chain, and yet every link rings true."
You can refer to the last few pages of the story to read a detailed explanation of the solution to the mystery in Holmes' own words in just four paragraphs. Doyle's creation of Sherlock Holmes was inspired, as he readily acknowledged, by some of the tales of "ratiocination" of the great Edgar Allan Poe. It can be observed that Poe has his hero explain his investigations, observations, and deductions at the end of such stories as "The Murders in the Rue Morgue," "The Purloined Letter," and "The Gold Bug." As previously mentioned, Doyle followed this narrative practice in many of his Sherlock Holmes stories, including "The Red-Headed League."