This is a jataka story, which means it is a "birth story" of the Buddha, a story of one of his past lives. In this story of the past, the Buddha was born as a white crane, and a very wise crane at that!
I am using the version found in Joseph Jacobs' book of Indian fairy tales, which I have slightly shortened here:
THE LION AND THE CRANE
The Bodhisatta was at one time born in the region of Himalayas as a white crane.
It chanced that as a lion was eating meat a bone stuck in his throat. The lion's throat became swollen so that he could not take food, and his suffering was terrible.
The crane aw the lion as he was perched on a tree looking for food, and asked, "What ails you, friend?"
The lion told him.
The crane said, "I could free you from that bone, friend, but dare not enter your mouth for fear you might eat me."
"Don't be afraid, friend, I won't eat you; please just save my life."
"Very well," says the crane, and caused the lion to lie down on his left side. But the crane also thought to himself, "Who knows what this fellow will do?" So he placed a small stick upright between the lion's two jaws that the lion could not close his mouth. Then, inserting his head inside the lion's mouth, the crane struck one end of the bone with his beak, and so the bone dropped and fell out.
As soon as the crane had caused the bone to fall, he got out of the lion's mouth, striking the stick with his beak so that it also fell out. The crane then settled on a branch.
The lion got well, and one day was eating a buffalo he had killed. The crane thought "I will test him," and settled on a branch just over the lion. He spoke the following verses to the lion:
A service have we done thee
To the best of our ability,
King of the Beasts! Your Majesty!
What return shall we get from thee?
In reply the Lion spoke the second verse:
I feed on blood, I say,
And I always hunt for prey,
'Tis much that thou art still alive
And, though in my teeth, thou did survive.
Then in reply the crane said the other verses:
He's unkind, ungrateful, and also rude;
In him there is no gratitude.
The lion's friendship is not won
Even by a good deed done.
Better softly go away:
He gives no reason I should stay.
And having thus spoken the crane flew away.
The illustration is by John Batten: