We don't always! Lexicographers generally have wide vocabularies and fairly good general knowledge, but none of us is familiar with all of the words that we deal with. We discover the meaning of the word by looking at our databases and files of language and by consulting reference works.
Dictionaries are descriptive, not prescriptive. In other words, when defining a word we combine our understanding of how it is used in the language with an analysis of resources such as the Oxford English Corpus and the Oxford Reading Programme. This should result in a definition of how a word is actually used rather than how we think it should be used.
For scientific and technical terms we make use of our well-stocked library or the Internet or consult a colleague with specialist knowledge.