Dr. Livesey takes over as the narrator of Treasure Island from chapters 16 to 18. Before and after this, it's Jim Hawkins who tells us what's happening in the story. The change of narrator allows Stevenson to fill us in on details and events that are important to the story, but which Jim's not able to witness. It also heightens the suspense; we notice Jim's absence since he's been the narrator for the first fifteen chapters, and now all of a sudden he's gone.
As an adult, the good doctor can also give us a more mature perspective on things. Jim's a perfectly reliable narrator, but he's still just a young lad and so naturally he'll have a different take on events. And up until this point in the story, those events have moved along at a rollicking pace. Dr. Livesey's narration adds a sense of plausibility to all the excitement we've witnessed. All the same, Livesey's observations are rather similar to Jim's so there's no significant break in continuity when he picks up the story.