According to Steven Pinker, in The Stuff of Thought:
Homonymy usually arises when an ancestral word budded off new senses in a language's history and current speakers retain no inkling of the original connection. For instance, the word odd originally referred to something that stuck out, like the point of a triangle. Then it was extended to refer to something that metaphorically stuck out because it was unusual, and then was extended further to refer to a number that had one unit sticking out from a pair.
Homophony, on the other hand, is defined as a phenomenon
in which distinct words are pronounced the same way, usually because their original pronunciations got merged in the history of the language. For example,
four and fore sound alike today, but four originally rhymed with tour, and fore originally rhymed (more or less) with flora; we see fossils of the old pronunciations in the way the words are spelled.