How does the Dewey system work?

the Dewey system is something which is in all librarys basically it is a way that books are organised in things like alphabetical order and numeral order.