What does it mean?
Things sometimes look different than they really are. A restaurant that looks old and small might have amazing food, for example.
Where does it come from?
The phrase goes back to at least the mid-19th century, as seen in the newspaper Piqua Democrat, June 1867:
Don’t judge a book by its cover, see a man by his cloth, as there is often a good deal of solid worth and superior skill underneath a [???] jacket and yaller pants.”