As books became more prevalent and libraries formed to house and collect books, people needed a way to organize and find them. In Roman times libraries needed less organization. There was a place for writings in Greek, and writings in Latin. Those that could read knew who the authors were and could find writings by knowing who wrote them: "Socrates, Plato, Ah here we go: Aristotle."
Ok, so it was not ideal, but it worked. But in modern times libraries had many more books to choose from, many more subjects and available to a wider audience. Each library did things a little differently, until Melvil Dewey came up with a system of organizing the knowledge of the library. You have to love the Dewey Decimal System.
Burke, J.J. (2009). Neal-Schuman library technology companion: a basic guide
for library staff (3rd ed.). New York, NY: Neal-Schuman Publishers.