The gun Zam-Zammah is a real cannon that actually does stand in front of the Lahore Museum. It was made in 1757 on the orders of Ahmed Shah Durrani, a.k.a. the Conqueror of Thrones (we wish that was our nickname—it sounds so George R.R. Martin-y…). Kipling writes that "the great green-bronze piece is always first of the conqueror's loot" (1.1), which is historically true: it has been seized many times by different armies.
But beyond Kipling's historical accuracy, there is a symbolic value to the gun Zam-Zammah in the book. When the novel first opens, the narrator announces that Kim is sitting "astride the gun Zam-Zammah," and that, "who hold[s] Zam-Zammah […] hold[s] the Punjab" (1.1). Kim is literally holding the gun—with his legs, at least, since he is sitting on the thing—and so, symbolically, Kim holds the Punjab (a state in British India; it's now been sub-divided with the partition of India and Pakistan in 1947).
Kim may not have a part in the administration of British India, but he knows and loves India so thoroughly that he can travel unnoticed through it in any number of disguises (all the while watching the people around him to see how he can make them work to his advantage… which is kind of creepy). So in a way, Kim does control India through his supreme understanding of its people. Kim's association with Zam-Zammah proves that Kim is or will be an authority figure in India.
(Kipling also makes Kim's authority over Zam-Zammah, and thus, the Punjab, a proof of his race as an Englishman. He writes: "There was some justification for Kim [… holding Zam-Zammah] since the English held the Punjab and Kim was English" (1.2). For more on Kipling's racial politics, check out our "In a Nutshell" section.)