Nag is a very large cobra, and Rikki is a very young mongoose. Nag was "five feet long from tongue to tail," but Rikki was such a young mongoose that he had never even "met a live cobra before." Nevertheless, when Rikki learns that Nag intends to kill the man, woman, and child, he is tingling with rage despite being afraid of the size of the snake. As Rikki surveys the sleeping cobra, he realizes that if he does not break Nag's back the first time he jumps on him, and if Nag is able to fight, his chances will not be good. The very thickness of the snake's neck under its hood is beyond the ability of Rikki's young teeth to effectively pierce, and biting the snake near the tail will only make the cobra violent. Rikki realizes he must bite the snake on the head above the hood, and that when he does so, he must not let go, no matter how hard the snake thrashes.
This is exactly what Rikki does, and Nag whirls him "round in great circles." For a time it seems as though Rikki will be bashed to death by the snake's thrashing. Rikki determines to hang on even in death in order to bring honor to his species, so he clamps down even harder, despite the pain and dizziness he experiences. Thankfully the noise awakens the man and he comes with his shotgun. Rikki believes he is dead, but the man credits the mongoose with saving their lives. Rikki goes to sleep that night after "shaking himself tenderly to find out whether he really was broken into forty pieces, as he fancied."
Because of the cobra's large size and Rikki's inexperience and youth, the battle between Nag and Rikki is not at all certain to go Rikki's way. But between the mongoose and the man, the snake met his match.