The book the element of the musical that consists of plot, characters, and spoken dialogue. The book writer is the person who develops the plot, characters, and dialogue for the stage. These can be original, or an adaptation of an older work (movie, novel, non-musical play, etc.), or based on a historical situation. It is the book writer's responsibility to ensure that the musical has a satisfactory dramatic arc.
The Wikipedia entry for book writer says:
The book writer is the member of a musical's writing team who creates the book—the musical's plot, character development, and dramatic structure. Essentially, the book writer is the playwright of the musical, working very closely in collaboration with the lyricist and composer to create an integrated piece of drama.
There is a common misconception that the book writer merely writes the dialogue; though the book does include the musical's spoken text, it is much more than that, defining and organizing the dramatic action of the entire piece, including action that is musicalized by the songwriter(s). Even "sung-through," "operatic," or "through-composed" musicals, where there is little, if any, spoken text, require as much contribution from a book writer as do musicals with extensive dialogue scenes.
The book writer is often also the musical's lyricist, composer, or director.
The script for a musical consists of the book as well as the lyrics. Sometimes the book writer also writes the lyrics, and perhaps even the music, e.g., as Lin-Manuel Miranda did for Hamilton. But more typically, those are distinct roles, as with Bonnie and Clyde.