Books have inspired all kinds of different media, video games included. It's pretty rare for games to be directly taken from books, which means there are a lot of video games you didn't know were books first. Games tend to adapt features, atmospheres, and ideologies from books, which makes for intriguing stories and hidden Easter eggs for the most observant of players.
Games writing is its own unique animal, which is part of the reason that video games inspired by books tend to crib ideas or atmospheres from books rather than be outright, moment-by-moment adaptations. Both kinds of video games based on books exist, of course, but the realities of writing for games mean it isn't as easy as writing a story and having the developers, designers, artists, and so on make it a reality. But that's what makes games based on books special: they're enjoyable not just because they replicate our favorite stories, but because they do so by translating them to an entirely new form and method of experience.