Here's how it happens:
* Pinocchio's selfless act: He chooses to sacrifice himself to save Geppetto from the whale, demonstrating true courage and love.
* The Blue Fairy's reward: Recognizing Pinocchio's change of heart and his act of bravery, the Blue Fairy grants his wish to become a real boy.
* Pinocchio's transformation: He finally becomes a real boy, fulfilling his dream and proving that he has learned valuable lessons about honesty, courage, and love.
The ending of the story emphasizes the importance of these values and suggests that even a wooden puppet can achieve good and become worthy of being called a true human.