Prior to killing Karait, the young mongoose named Rikki-tikki-tavi has encountered the big black cobra Nag and his "wife," Nagaina. He is feeling quite proud of himself at this time and is increasing in confidence because he is able to avoid an attack from the rear by Nagaina.
Rudyard Kipling spends time in this story from The Jungle Book developing the character of Rikki-tikki-tavi. He explains that it is the character of a mongoose to not be afraid of anything.
It is the hardest thing in the world to frighten a mongoose, because he is eaten up from nose to tail with curiosity. The motto of all the mongoose family is "Run and find out," and Rikki-tikki was a true mongoose.
Rikki-tikki-tavi was raised by his mother to know the purpose of his life was to kill and eat snakes. She also taught him how desirable it is to live in the house of men, so Rikki quickly bonds with the family that saves him.
After his encounter with Nag and Nagaina, Rikki encounters Karait. The narrator tells readers that Karait is more dangerous than Nag and Nagaina because his body is so small. If Rikki misses or strikes Karait in the wrong place, he could die. Before the encounter, Kipling explains that the idea that a mongoose knows about a magic herb to protect it from a snake bite is a myth. All they have is their courage and quickness in defense against an attack from a snake.
He went away for a dust bath under the castor oil bushes, while Teddy's father beat the dead Karait. "What is the use of that?" thought Rikki-tikki. "I have settled it all"; and then Teddy's mother picked him up from the dust and hugged him, crying that he had saved Teddy from death, and Teddy's father said that he was a providence, and Teddy looked on with big scared eyes. Rikki-tikki was rather amused at all the fuss, which, of course, he did not understand.
This passage explains how Rikki is feeling after killing Karait. He doesn't understand why Teddy's father strikes at the snake, because he knows with total confidence that he killed the snake himself. He also doesn't understand Teddy's mother's crying. The parents think that it has been divinely ordained that Rikki has come into their lives to keep their family from the danger of snakes. But to Rikki, he's simply doing what mongooses do—and that is killing snakes. He thinks about eating Karait after killing him, which his mother taught him to do, but the family is keeping him well fed with eggs, bananas, and raw meat, so he is satisfied, and decides that eating the snake will only slow him down.
After he has killed Karait, we are told that Rikki-tikki-tavi is "thoroughly enjoying himself." He doesn't seem to experience any guilt or remorse for killing the snake. On the contrary, however, we are told that the snake is very dangerous and could have done significant damage to the family. Rikki-tikki-tavi seems to draw impulsively upon his instincts as a mongoose, knowing that he should not eat the whole snake because this would make him full and would slow him down. Instead, he springs onto the snake's back and delivers a bite which paralyzes him, and then leaves the snake. Feeling that he has settled the matter, he is puzzled by Teddy's mother's screams, but enjoys the subsequent petting and fuss he receives for having dispatched the dangerous snake and saved Teddy from death. He doesn't understand why he is being petted, as to him the killing of the snake was simply instinctive and not a valorous act, but he enjoys it all the same.