At the start of Kipling's Kim, we find this young guy who has a ton of imperialist potential: he belongs by blood to the ruling class dominating British India in the late nineteenth century, but he doesn't always show his elite status. In fact, he's really good at pretending to be anyone he needs to be in order to make the crowd around him comfortable.
He's also good at gathering information and at keeping secrets until it seems like the right time to tell them. He was born to be a spy—he just needs some more formal training and discipline to develop his loyalty to the British Indian State. As Mahbub Ali says poetically a bit later on in the novel, "Only once in a thousand years is a horse born so well fitted for the game as this our colt. And we need men" (9.151).
So to get the ball rolling in the first chapter, and to bring Kim to the attention of the British Secret Service, the novel gives Kim an unofficial mission—delivering a secret message from Mahbub Ali to Colonel Creighton—while he is traveling as his new friend the lama's disciple. It's this first outing that brings Kim into the world of official English education and future employment as a British Indian Secret Service agent.
(Another FYI: as we have said in our "In a Nutshell" section, the premise of Kim is totally, unapologetically pro-colonial in its portrayal of race in India. We're being as blunt as we can be about the book's imperialist politics, even as we explore the ways in which the novel presents its characters and plot in surprisingly complex and sympathetic terms. So—just putting this all out there.)
Once Kim connects with his father's regiment in Chapter Five, stuff gets real. He's no longer just a young guy doing whatever he wants because it pleases him. He has to learn math, map-making, and measurements; he has to study with Lurgan to improve his memory and to assess the characters of the people around him. Even though he is already super-talented at disguise, he has to keep perfecting his art in his travels with Mahbub Ali.
Apparently, these are all the skills you need to become a spy. It's funny—watching James Bond movies, we would have thought there would be more marksmanship, spectacular-sports-car-driving, and explosives training involved. But we guess this was the 1890s, so there were probably fewer gadgets and more actual, literal spying on other people. In all, Kim spends three years, from age fourteen-ish to age seventeen, getting ready to become a real, live Son of the Charm—a member of the British Indian Secret Service.
And at last, the day comes (before he actually graduates from school, incidentally) when Creighton finally declares that Kim is ready to go back out on the road for a six-month trial of his skills.
Arrival and Frustration
So now it's Chapter Eleven, and Kim leaves school once and for all and meets up with his lama in Benares to help him find the River of the Arrow. Kim is back on the road, he's getting a (very small) salary from the British Government to support his six-month trial run as an agent, and all should be right with the world.
Except it's not: Kim feels confused about who he really is and what he is doing with himself. Not only does he literally ask himself, "Who is Kim—Kim—Kim?" (11.4), but he also feels defensive and annoyed when the lama criticizes him for his "pride" (11.194) in helping to disguise Agent E.23 to escape his enemies. Even though Kim is finally free to pursue his chosen career as a grown man, he finds that he has lost some certainty about what it means to participate in the Great Game.
The Final Ordeals
Kim may feel anxious about his travels with the lama, but that doesn't stop him from pushing north to the Himalayas when the Babu tells him about two upstart Russian agents making trouble with the northern kings Hilas and Bunar. This mission with the Babu is the final proof of Kim's ability to be an effective spy: he has to capture the papers of these two guys to prove that Hilas and Bunar have betrayed their agreements with the British government.
In fact, this mission also brings Kim's two roles in the novel—as the lama's almost-grandson and as a secret agent for the British Indian government—together at last. After all, the Russian agent's violent confrontation with the lama over the lama's painting of the Great Wheel causes the highly religious people of this village to kick both Russian agents out of the hills, leaving their baggage—and their politically important papers—behind for Kim to collect.
This encounter between the lama and the Russian agent leaves both Kim and the lama shaken. The lama feels guilty over his rage at the Russian agent; he thinks that if he were really a good student of Buddhism, he would have been able to respond to the agent's physical attack with calm and peace. And Kim feels bad about the lama's moral struggles; he thinks that his divided loyalties between his mission and the lama may have made him careless with the lama's safety.
But in Chapter Fifteen, both Kim and the lama put their worries to bed. The lama has a vision of his Enlightenment, which he decides to stay on this earth to share with his beloved almost-grandson, Kim. And Kim realizes that his purpose on this earth is to gather information and to travel across India: that's what he does. He has not neglected the lama at all, and he has exceeded expectations in his first genuine mission for the Secret Service.
Over the course of the novel, Kim has become an official spy and the lama has become the best Buddhist that he can be—both of them have succeeded in their quests and can live happily ever after.