Sir Arthur Conan Doyle may have based the character of Professor James Moriarty on the real-life arch-criminal Jonathan Wild (1682-1725), whose exploits made those of his fictitious counterpart look somewhat unimaginative by comparison. According to Wikipedia, for example:
He ran a gang of thieves, kept the stolen goods, and waited for the crime and theft to be announced in the newspapers. At this point, he would claim that his "thief taking agents" (Bounty Hunters) had "found" the stolen merchandise, and he would return it to its rightful owners for a reward (to cover the expenses of running his agents). In some cases, if the stolen items or circumstances allowed for blackmail, he did not wait for the theft to be announced. As well as "recovering" these stolen goods, he would offer the police aid in finding the thieves. The thieves that Wild would help to "discover", however, were rivals or members of his own gang who had refused to cooperate with his taking the majority of the money.
In Valley of Fear, Holmes comments on the similarity between Wild and Moriarty [source]:
Everything comes in circles—even Professor Moriarty. Jonathan Wild was the hidden force of the London criminals, to whom he sold his brains and his organization on a fifteen per cent. commission. The old wheel turns, and the same spoke comes up. It's all been done before, and will be again.
Like Moriarty, Wild ended up dying a violent death, but his end came on the gallows.