In the chapter called "Kaa's Hunting," Baloo and Bagheera enlist the aid of the great thirty-foot python in recovering Mowgli from the Monkey People. Both the bear and the panther are afraid of the snake, though they are not his natural prey and the monkeys are. They approach Kaa cautiously and, among other inducements to help them, recount that the monkeys have been insulting him, calling him a yellow earth-worm.
In fact, the monkeys are terrified of Kaa, which is why Baloo and Bagheera want his help so much. Kaa's principally eats goats and other ground-dwelling animlas, but he can climb through the trees as well as the monkeys and sometimes preys upon them. The figurative language describing his hunting comes from the monkeys' descriptions. They say that he can slip along the branches "as quietly as moss grows, and steal away the strongest monkey that ever lived." They also say that he can make himself look "like a dead branch or a rotten stump," though this is a deliberate effort on his part to resemble a piece of wood, rather than simply a descriptive simile. Although it seems that "yellow earth-worm" is a formulation made up in this instance by Baloo and Bagheera to anger Kaa against the monkeys, his recognition of the term and his repetition of the similar term "yellow fish" show that he is used to such figurative language from them.