You have probably come across the term "thesaurus" for the first time when you were using your writing program. When you selected the feature, you were offered a dictionary with alternative items.
Basically, the thesaurus as a search tool for databases is structured in a similar way. Instead of using a word list with many variations of the same item, the controlled terms, the descriptors (mostly specialist vocabulary with a defined spelling), are arranged in a hierarchical order according to certain rules. Hence, they are not just sorted alphabetically like in a Index list, but they are ordered according to certain term relations. This order facilitates a search of a big amount of data.
An example: The term relations are defined and therefore standardized in the ISO 2788 and the ISO 5964. By assigning the items according to a certain system (term A is "a form of" or "a part of" term B), broader terms and narrow terms are created in a hierarchical order. Let us take the item "Eye" from the Medical Subject Headings (MeSH - Theraurus of the Database MEDLINE) as an example. Moving up the hierarchy into the broader terms, you will find the items "Face", "Head" and finally "Body Regions". This example shows that the broader your search items are in the thesaurus (Body Regions), the broader and less precise are your search results, i. e. your search results will also contain publications concerned with the face and head, and not just the eye. If you want to have a more precise search result, you choose the narrow term and get fewer hits.