The Indian Rebellion of 1857 was an uprising by Indian soldiers working for the British East India Company in response to race-based mistreatment. While the Rebellion itself was quashed by the British Army, it became the spark for a long cultural rebellion by India against British Rule.
In Kim, Rudyard Kipling presents an India removed from the Rebellion, but with the bitterness and consequences of it still fresh in the memories of both sides. Kim himself is a product of the Rebellion; he is a white orphan raised on the streets, but has the ability to adapt and blend in with both the upper-class and lower-class. Kim retells stories he has heard and connects with The Old Soldier, who fought for the British in the Rebellion, and who now dismisses Indian customs and traditions:
"A madness ate into all the Army and they turned against their officers That was the first evil not past remedy if they had then held their hands But they chose to kill the Sahibs wives and children Then came the Sahibs from over the sea and called them to most strict account."
Since the uprising was a direct result of British attitudes toward India and its customs, the Old Soldier's attitude is typical, and his conversations with Kim and the lama show how bias -- not necessarily negative prejudice, but more of a common opinion -- is ingrained through repetition. The Rebellion, therefore, acts as both background and instigation for the attitudes, intolerance, and cultural conflicts present in the book.