Kim travels to Quetta—which is in modern-day Pakistan—where the horse-trader Mahbub Ali has secret business to attend to. Kim helps Mahbub with his business affairs by agreeing to spy on his behalf. Mahbub is himself a spy, working as an operative for the British colonial authorities. Later on in the story, Kim will develop his own espionage skills when he manages to spirit away some useful documents from the Russians that they'd been planning to use in their dastardly plot to undermine the Raj.
It's in Quetta, however, where Kim first displays his talents as a would-be James Bond. He manages to wangle himself a job as a scullion—a general dogsbody—in the office of a fat Commissariat sergeant. This gives him access to a ledger-book in the sergeant's box, which contains, much to Mahbub's disappointment, nothing but records of various cattle and camel deals, rather than the high-grade intelligence he was expecting to find. But Mahbub's quite stoical; he figures that the sergeant is just a small fish whose lowly position means that he doesn't have access to the kind of intelligence he was hoping Kim would find for him.