First, because the big bookshelf accounts for 150 more than the small bookshelf, there is a difference of 300 between the big bookshelf and the small bookshelf.
Second, the small bookshelf takes 150 to the large bookshelf, with a size difference of 600. This 600 is equal to 50 extra books after the small bookshelf is taken away, so there are 550 books left after the small bookshelf is taken away, so there are 700 books in the small bookshelf.