The Bodhisatta was once a partridge. He was best friends with a monkey and an elephant and the three of them treated each other as equals. As time went on they all agreed it was unseemly for them to act as equals and the subordinates ought to show deference and honor to whoever was their elder. But first they had to know who was the oldest.
They sat at the foot of a banyan tree and each told how tall it was in their earliest memory of it. The elephant remembered walking over it and the topmost branches scratched its belly. The monkey remembered eating from its top branches while still sitting on the ground. The Bodhisatta remembered eating from a giant banyan tree nearby and voiding the seeds that grew into this tree. Since the Bodhisatta was the oldest, his friends took their proper order in life and henceforth sought his counsel and gave him respect.
In the Lifetime of the Buddha
One time while the Buddha was traveling, his senior disciples were the last to arrive in town and the disciples who had come earlier had already filled all available rooms. That night, Sariputta, one of the Buddha’s top disciples, had to sleep under a tree. In the morning, after he found out what had happened to Sariputta, the Buddha called his disciples to assemble and rebuked them for their lack of courtesy and subordination. He explained that honoring seniority was a virtue and told them this story so they knew that even animals have proper behavior. After this incident the Buddha made it an offence for disciples to not provide the best lodging, water, and rice to the senior-most among them.
The monkey was an earlier birth of Sariputta and the elephant was an earlier birth of Moggallana, another of the Buddha’s top disciples.