Why can the legendary little bamboo bear of Nezha talk?

That is the effect of someone dubbing them so that they can speak.

The cute animals in the Legend of Nezha, the little bamboo bear and the little pig bear, are raccoons, commonly known as little raccoons. Piggy Bear’s original name is Xiao Bamboo Bear, and he is a bamboo rat. Because he was afraid of being taken to the river for roasting for various unreasonable reasons, he named himself Piggy Bear.

In reality, this animal is called a raccoon. Raccoons are between 42 and 60 centimeters long. They have well-developed senses on their feet and often use their front paws to hunt and eat. They are almost as flexible as monkeys. Raccoons often put the food they catch in water to wash away the sediment, hence the name "raccoon". Raccoons are omnivores, eating fish, frogs and small land animals, as well as wild fruits, nuts, seeds, acorns, etc.