Big Bungalow, Bigger Garden
The setting of "Rikki-Tikki-Tavi" is restrained to a bungalow and its garden, so we don't have travel far to take in all the sights. But even though it's a small setting, the landscape is filled with subtle meaning and context that's super important if we're to understand the conflict between Rikki-tikki and the cobras.
Heaven in a Bungalow in the Sun
The human's bungalow is a place of wonder and bounty for a mongoose like Rikki-tikki. There, he's constantly presented with more food than he can possibly eat, and the place is filled with such (then) modern wonders as a bathtub, kerosene lamps, writing-table, and western-style beds (15). Like most other aspects of the novel, how we read the bungalow depends on how we read the story as a whole.
If we take the classical route, the bungalow represents a safe haven from the wilds of the garden (which we'll get into in a minute). Like Camelot or the Shire, it's the place where the hero finds safety from the dangers of the world. It's also the place the hero must protect at all costs to maintain peace throughout the land, erm, backyard at any rate.
But if we read the story via postcolonial theory, the bungalow takes on a distinctly different appearance. It becomes the site of colonial power within the garden and represents "the impact of Western technology on an ancient, essentially spiritual civilization" (source). In other words, what was once a part of India has now been taken over, replaced with a bungalow to house the colonizer and his family. In this light, the bungalow seems the invading force, disrupting the natural balance of garden. And speaking of the garden….
It's a Jungle Out There
The garden is technically a part of the bungalow's plot, but it remains "only half cultivated, with bushes as big as summer-houses of Marshal Niel roses, lime and orange trees, clumps of bamboo, and thickets of high grass" (18).
This description sets this garden apart from anything Kipling's British or American readers would find in their backyard. The bamboo and citrus trees give it a distinct feel of what they'd have called the Orient—i.e. various parts of Asia. Its status as "half cultivated" suggests a wild, jungle-like vibe, a foreign place for its British inhabitants.
Just like the bungalow, we will read the garden differently depending on our take on the story. If the bungalow is seen as the safe haven for Rikki-tikki, then the garden is its counterpart—an uncivilized, wild, and dangerous landscape. It is the home to the villainous cobras, so, like Mordor in The Lord of the Rings, it poses a risk to the protagonist's safe haven. Our hero must conquer or tame it or, at the very least, return alive (preferably all three).
On the other hand, we can also look at the garden as India itself. Under the pressure of colonial rule (the bungalow), the garden has become half cultivated, meaning that part of it is shaped by the colonists but part of it remains as it once was. The dangerous cobras lurking in it aren't villains trying to destroy the hero's safe haven; they're natives trying to preserve their way of life. The danger it poses to the human characters has less to do with its inherent evilness that with bone-headed humans not knowing how to deal with it.
Of course, you can read these places differently if you read the story in a way other than the classical or postcolonial. Feel free to open up your interpretations to fit your own reading of the story.