The main idea of Treasure Island is that while greed motivates the pirates' search for the treasure, for a young person like Jim Hawkins, who is coming of age, the journey for the treasure is the reward. Through the many perils he faces, Jim comes to a far greater maturity, courage, and wisdom than when he started out.
Jim begins as a timid young man who is easily frightened by the sailors and the stories they tell at his parents' inn. However, he has a taste for adventure, despite his fears, and goes off with them as a cabin boy. He learns the pirates' code of honor, and this becomes important to him. Throughout the story, we see Jim testing his mettle as he meets his fears and matures.
Jim faces reality and grows up when he realizes that Long John Silver, an authority figure he admires, is planning a mutiny. Jim shows his courage when he battles the mutineers at the stockade, and he shows his wits when he cuts the Hispaniola adrift and boards the ship alone to face the mutineers.
In the end, adventure and growth prove to be the valuable rewards of Jim's journey. He shows little interest in the treasure and, having matured as a person, he is ready to put his pirating days behind him. He ends his account with the thought,
The bar silver and the arms still lie, for all that I know, where Flint buried them; and certainly they shall lie there for me.