Before Yann Martel wrote "Life of Pi," he had written 2 previous novels that had completely flopped. They didn't get very good reviews, and had little or no success in the market. He was feeling completely discouraged about writing, and about the power of a really good story to have any impact or success in our world. He was hungry for validation that stories, imagination, and a good tale was still something that could add a lot of meaning, enjoyment and success to one's life. He traveled a lot, drifting aimlessly, trying to find a good idea for a story. He was hungry for a good tale, one that would capture his imagination and his excitement. While he was traveling in India, he read a book about a man and a panther on a lifeboat--Martel thought to himself, that's it! THAT's the great story idea that I have been hungering for. If it hadn't been for Martel's searching for a great story that lights the imagination, if it hadn't been for his hunger for that validation in this world, "Life of Pi" might have never been written. Despite the fact that his 2 previous novels flopped, he still hungered for a story that would succeed, not only in the world, but in restoring his faith in the power of the imagination.
A major theme of "Life of Pi" itself is that of imagination and its power to make life wonderful and fulfilling. In fact, he compares life without imagination or storytelling as "dry, yeastless factuality," and presents the animal story as an alternative to that horrid and awful reality that might have been. Little Pi asks his Japanese interregators at the end which story they like better, and they readily admit, "The story with the animals." Martel is asserting that stories, imagination, a good tale, makes for a better existence here on earth. He found the idea for the story because he was hungering for a good idea, and the entire theme of the story is that of feasting on the power of the imagination.
I hope that those thoughts help a bit; good luck!