TeX not only handles hyphenation, but also decides on where in a certain word it should hyphenate to optimize the current paragraph as a whole, balancing the hyphenation position in the word (some positions are better than others) against the aesthetics of the paragraph.