Rudyard Kipling's 1894 classic, "Jungle Book," features a short story about a family's pet mongoose that saves them from two deadly cobras. The story of the heroic "Rikki-Tikki-Tavi" has been popularized in subsequent films and stories, contributing to public perception of mongooses and cobras as natural enemies.
Mongooses do hunt and eat venomous snakes. The small size of these animals and human fears of cobras contributes to the lore of the mongoose versus cobra. Mongooses use their agility and immunity to snake venom to kill their prey. In reality, mongooses don't often kill cobras because they don't like the taste of their meat.