Life of Pi is a magical realism novel that blends elements of fantasy (such as the carnivorous island) that require the reader to suspend their disbelief. It also covering realistic problems: tragedy, trauma, and grief, but also relatively mundane concerns like hunger and sunburn.
In blending together the fantastical and the real, the book encourages the reader to relate to Pi while also making his journey seem larger-than-life and spiritually meaningful. It uses magical elements to replicate the emotional and spiritual experiences that Pi feels that cannot be captured by plainer descriptions. An obvious example of this is Pi’s account of the story without animals, which he regards as inferior to the version of the story with animals. Furthermore, magical realism acts similarly to many religious texts, which can incorporate seemingly unrealistic aspects, such as miracles or visions, into otherwise realistic settings. In both cases, miracles and magic exist not only to inspire wonder but also to provide commentary on the real world and the human condition.
Furthermore, Life of Pi is a survival novel, as it centers on the titular character's struggle to make it back to civilization after he's stranded at sea. Books in this genre usually feature a protagonist who must draw on their physical and mental strength in order to endure trying situations, and they are often stranded or otherwise isolated from other people. Many survival novels use the protagonist's physical journey to parallel a deeper emotional or spiritual transformation that they experience, and this is certainly the case for Life of Pi.