Yes and no. I can explain the code portion, but I’ll give you a simpler answer as you requested.
When you search for a piece of text, the code will generate the rest of the page at random. Each page is 3200 characters, so if you searched for “library” (a 7 letter word), it will have to randomly generate 3193 characters. It will split those 3193 and place a random portion before and after your text. So it can either put 0 characters before (meaning “library” will be the very first thing on the page) and the 3193 random characters after, or generate 3193 characters first and place your text last (meaning “library” will be the very last thing on the page), or anywhere in between.
After it has generated the whole page, it feeds it into the inverse algorithm, which will spit out the hex, wall, shelf, and book numbers. When looking up a book, you have to provide those numbers, but the algorithm used is the regular one (not inverted), so it will find your page every time.
You’ll notice this behavior if you search for a whole page (3200 characters). Your first result will always be the same one. The rest of the results are just more random generation, by shifting where in the book that page is.
So yes, it generates the books randomly, but no the locations are not random. The set of search results that you see are random, but each location is predetermined by the code.