The Jungle Book is set in India, where Kipling spent the first several years of his life. He returned there to work as a young adult when his family did not have the money to send him to Oxford.
Kipling therefore knew colonial India very well and used a jungle setting, with animals most British children would not be terribly familiar with, such as tigers, cobras, and panthers, to add to the interest of the stories within The Jungle Book.
By showing the world through the eyes of the animals, Kipling was able to convey the idea that British colonial rule in India was the natural order of things. For example, the wolves and most of the other animals know that it makes no sense to try to kill humans or their cattle. The humans will retaliate through
the arrival of white men on elephants, with guns, and hundreds of brown men with gongs and rockets and torches.
Such imagery put the British colonizers in the superior position vis-á-vis native Indians. In this passage, the British are on elephants and have guns, while the "brown men" (Indians) are a mass on the ground with less sophisticated tools.
Kipling thus uses the Indian setting not to critique British imperialism but to uphold it as part of a natural and unquestioned hierarchy that is replicated as well in the animal kingdom. British rule determines jungle rule among the animals, thus the reach of empire is everywhere and depicted as normal.