The Book of Life and Death is one of the Three Books of Heaven, Earth, and Man (天地人三书 tiān dì rén sān shū). It is a complete registry of all humans and animals, from the day they are born, until the day of their preordained death.
The Monkey King's Journey to Di Yu
After gaining immortality and the Magic Wishing Staff (如意金箍棒 rú yì jīn gū bàng) from Ao Guang (敖广 áo guǎng), the Monkey King returned home. One day, after falling asleep, his spirit was captured by two demons, Ox-Head and Horse-Face (牛头马面 niú tóu mǎ miàn), who led him into Di Yu to be judged. Since being taken to Di Yu meant the Monkey King was now officially dead, he decided he wasn't having any of it. He fought his way out of his bonds but instead of escpaing back to his body, in a flurry of anger he fought his way through Di Yu until he came face to face with the king.
After witnessing what the Monkey King was capable of, Qin Guang Wang realised he had no choice but to submit to his will. The Monkey King ordered him to bring forth the Book of Life and Death so that he may remove his name from the records and never have to enter Di Yu again. And so he did. And as he searched through the pages he also removed the names of as many of his monkey companions as he could find, making himself, and those who were lucky enough to be found, impervious to death.