Rikki-tikki killed Nagaina by following her into her hole and fighting her to the death.
Nagaina was the female cobra in the garden at the Indian bungalow. Rikki-tikki killed her mate, Nag, earlier in the story. However, it turns out that Nag and Nagaina had eggs. Rikki-tikki knew that he had to kill all of the snakes in the garden for the family to be safe, so he killed all of the eggs except one and used that egg to lure Nagaina out of the house.
Nagaina is described as “Nag's wicked wife.” She certainly seems to be the planner of the two.
"When the house is emptied of people,'' said Nagaina to her husband, ``he will have to go away, and then the garden will be our own again….”
Nag wonders if there is anything to be gained by killing the people, and Nagaina convinces him that they won’t survive as long as the humans are there.
Rikki-tikki describes Nagaina as “worse than five Nags” when she finds out that he has killed her babies. She does indeed threaten the family, and Rikki uses the last egg to lure her outside. The other animals assume that once he follows her into her hole he is dead, because a cobra hole is very dangerous. Yet Rikki-tikki emerges alive.
Rikki-tikki kills Nagaina by cunning and skill. He is smart enough to save one of the eggs as an incentive for her to follow him. He also is able to kill her even in his hole. This demonstrates not only his bravery and devotion, but his luck and ability.