Orlick has a longstanding grudge against Pip. Pip is the reason for Orlick losing his job at Miss Havisham's; Orlick thought that he had a chance with Biddy and that Pip cost him that relationship, and Orlick knows that Pip suspects him of severely beating Mrs. Joe. After years of waiting for an opportunity to get revenge upon Pip, Orlick finds a way to get to Pip--he knows the truth about the convict (Magwitch/Provis). He sends Pip an anonymous note that mentions his "Uncle Provis," and Pip feels that he must investigate because the note has Magwitch's real name on it, and therefore, could prevent Provis from making his escape (from Compeyson and the authorities).
So, a rather unsuspecting Pip goes to the sluice house and is attacked and tied up by Orlick. All looks bleak for Pip until in true Dickensian coincidental fashion, Herbert shows up with help and defeats Orlick all while setting Pip free. It seems that Pip had dropped the mysterious note from Orlick, and that is how Herbert knew where to find him.