"Humans have a code of ethics," says Marc Bekoff, an animal behavior expert at the University of Colorado. "If I don't play a certain way, you won't play with me. Some animals have the same code."

Scientists recently discovered that animals who live in groups, such as elephants, foxes, and wolves, are especially likely to follow rules. If they don't, and each does its own thing, the group might break apart. Group members would be forced to live alone. Then they'd have a harder time hunting and raising their young.

That's probably why a traveling wolf pack stopped and waited to let its limping leader catch up. Similar social ties may have prompted a captive elephant to save her friend from drowning. Selfish reasons certainly motivated the male fox, who wanted to keep playing.

Sometimes, though, animals go out of their way to do what's right, even when there's nothing in it for them. Nobody knows why. "It might simply feel good to be kind, just as it does for humans," says Bekoff.

Read on for four surprising stories about nice behavior in the animal kingdom.

Foxy Friends

If your friend wasn't nice to you, what would you do? Maybe you would just walk away. That's exactly what a wild red fox did when she was play-boxing with another fox. The larger fox, a male, began pushing too hard. The little female didn't like roughhousing. She trotted away.

"He still wanted to play," says Marc Bekoff. So the male fox ran after his playmate, bowed down, and rolled over. His body language meant, "Don't leave, I'll play nice." The female gave him another chance, and the male wrestled more gently this time.

An Unexpected Gift

Finally! Sniff and the other wild chimpanzees stopped traveling and climbed into the trees. Primatologist Geza Teleki stopped, too. He'd been scrambling after them, through the forest in Gombe National Park, Tanzania, in Africa, observing their behavior.

Now, watching the chimps chow down on round, green mbula fruits made Teleki's own stomach rumble. Not intending to hike so far, he'd left base camp without provisions. Maybe he could knock down some fruits for himself. Grabbing a stick, Teleki poked and flailed, but he couldn't do it. Watching him, Sniff imagined himself in Teleki's place.

"Sniff knew I was hungry," says Teleki. "And he knew he could do something about that." Which is why this young and timid ape, who'd always avoided people, took a big risk. All on his own, Sniff picked another armload of fruits, swung down on a vine, and handed them to the astonished scientist.

One Good Turn

Toby was one generous Siamese cat. For ten years, the kindly kitty shared his food with a springer spaniel named Katie. After supper, owner Linda Gustafson of Wyncote, Pennsylvania, always divided up the table scraps. She'd drop some in Katie's bowl on the floor and some in Toby's dish on the kitchen counter. Gustafson kept the cat's dish up high to keep Katie from snitching Toby's treats.

As it turned out, Katie didn't need to steal; she only had to beg. Every night, the floppy-eared pooch scarfed down her ration in seconds. Then she'd sit and stare at the cat. And every night, Toby would relent. Using his paw, he'd flick several tasty tidbits down to the waiting pup.

Apparently, Katie appreciated it. Whenever Katie was curled up in her beanbag bed and the cat walked over, Katie would give up her nice, warm spot. "Toby would snuggle down in the center of the beanbag," says Gustafson, "and Katie would lie on the floor."

In a Pinch

The African savanna elephant must have been surprised. He was grazing alone in a swamp, in Kenya's Masai Mara National Reserve, when a stranger arrived. The stranger was a forest elephant. Forest elephants are smaller and have more rounded ears than savanna elephants do. And they usually stay in the forest.

But this fellow had caught his trunk in a trap. While freeing himself, he'd torn off the tip. "Once the pain stopped, he'd be able to feed on his own,” says wildlife biologist Kayhan Ostovar of Billings, Montana. Until then, he'd need help.

As if to explain, "the injured elephant walked up and stuck his trunk into the healthy elephant's mouth,” says Ostovar, who witnessed the encounter between the two elephants. And that's all it took. Elephants often aid members of their herd. But this savanna elephant didn't care that they weren't related. He reached down, uprooted a small acacia tree, and stuffed it into his new friend's mouth.

Want to read more? Check out the August 2007 issue of National Geographic Kids for more tales of animal kindness. On newsstands July 17, 2007.