The weight of the book gives an outside cue to “wake up” the abdominal muscles. They pay a little more attention when there’s an added stimulus. The book weight combined with the pull of gravity in this position work together to improve your muscle contraction.
Sometimes people start with a fairly heavy book. Over time the book is traded for a lighter one while still contracting the muscles with the same vigor. The goal is to be able to contract the abdominal muscles fully on your own without the added help.