Largely it has to do with if the book in question has withstood the test of time, paints a vivid picture of the time it was written, flies against convention, or still has relevance today.
For example, "White Fang" by Jack London isn't particularly relevant in this day and age, but its engrossing story keeps readers coming back to it even over a hundred years later, and its portrayal of the early 1900s is so incredibly fascinating. It's obviously a very dated story, but those aspects I've mentioned are what make it a classic.
"The Catcher in the Rye" by J.D. Salinger, on the other hand, is more about theme and tone, making it a timeless story that lends itself to becoming a classic. How it portrays teenage angst, loss, alienation, etc. is something that anyone can relate to, so that earns it a spot in everyone's memories.
Then there's novels like Jules Verne's "20,000 Leagues Under the Sea," which, like "White Fang," falls on the less pretentious side of literary classics and survives through time purely on the thrill and imagination of the story and setting. Actually, Verne's novels may be more relevant than ever today, because he was big on fun, escapist narratives and that's exactly what we love in 2015. Not to mention, he was one of the progenitors of science fiction, so that fact alone will always make him a name readers will seek.