Literally, this expression means that if someone is looking for a book to buy and read, the first thing that will probably grab their attention is the cover of the book. Based solely on the cover, a person may decide whether a book is or is not for them. As a result, they may overlook a book simply because of the cover appears plain or uninteresting to them. However, if the person would have open the book and look at what is inside instead of overlooking it, they may have found it to be pretty interesting after all.
This phrase also applied to people. People should not form an opinion on someone or something based purely on what is seen on the surface, because after taking a deeper look, the person or thing may be different that what was expected. People usually judge solely based on their outward appearance. However, if one were to get to know the person and see what is inside, 'opening' the person up, so to speak, then that one may be pleasantly surprised to find that the person is different to how they imagined.
I would like to share a video that illustrated well the meaning of this expression.
The video showed the shop owner would constantly hurt the homeless guy, shout at him, and chase him away. It was happened every day. However, the homeless guy still slept in front of the shop. Until one day, the homeless guy never returned. When the shop owner checked his CCTV, he found that something important, but it is too late to realize its relevance.
* Kindly remind: NEVER JUDGE A BOOK BY ITS COVER!!!