Some books are impossible to write in a way that they can be understood if read linearly (dictionaries and encyclopedias are extreme examples).
Other books could be written so that they are very easy to follow, but they make poor reference books (most of Isaac Asimov's non-fiction books and essays are like this).
Other books, especially technical reference books, need to be organized into topics, and there will almost certainly be circular dependencies among those topics (Computer language books are like this).
When I learn a new computer language for instance, I start at the beginning and quickly read through to the end.
But I'll often see concepts that I don't understand, and sometimes I'll have to give up half way through a chapter and skip to the next because I'm totally lost.
But when I'm reading like this, I don't try to learn anything specific.
What I do is remember the concepts, ideas, and keywords, without necessarily understanding them.
Then, I'll read it again, but this time when the book refers to some new concept, I'll already have some idea about it from having seen it later in the book.
Not everything will make sense yet, but each pass through the book will become easier.
Eventually I'll decide I've got a good handle on what is there, even though I don't yet understand everything. Then I'll try to use what I've learned (i.e. write a program), and I'll use the book as a reference to look up the important details that I didn't learn. But what I did learn is that the details are in the book, and I have a good idea where.
You could compare the process to getting a quick look at a painting.
The first time you learn that it's a forest scene.
The second time, you recognize pine and birch trees, and you see a clearing with something in it.
The third time you get more details about what that something is.
And so on.
Eventually you'll be studying the details of the artist's brush strokes.
But to answer the question, if a book should be read superficially, you'll know it; almost every time you start a new chapter you'll find yourself struggling to understand what it's talking about.
(Of course some books will be impossible to understand no matter how many times one reads them.)