You can seed a field by putting seeds into the soil, but you can also seed a watermelon by taking seeds out of it. "Fast" can mean "moving quickly" (as in "running fast") or it can mean "not moving" (as in "stuck fast"). How can that be?
Words that have one meaning but also have an opposite meaning are known as contronyms.
What I would consider to be true contronyms are also homographs - distinct words with different etymology which happen to have the same form. One word like that is cleave. It means "to separate" which comes from Old English clēofan. That is where we get the noun cleaver, a tool with a heavy broad blade used by butchers for chopping meat. But cleave also means the opposite, "to adhere"which is also from Old English clifian.
You might also see the terms "autantonym" used for these types of words. That term was coined by Joseph T. Shipley in 1960, but in 1962 Jack Herring labeled them contronyms and that word is most frequently used.
sanction can mean to permit and also to penalize
bolt (which originally came from crossbows) means to leave quickly and also fixed. It can mean "moving rapidly" or "unmoving."
buckle can mean "fasten securely" as in "buckle your seat belt", or it can mean "fall apart" as in "buckle under pressure."
Some contronyms are because of national varieties of English. "To table a bill" in the U.K. and Canada means "to put it up for debate." But in American English it means the opposite, "to remove it from debate." The more logical British version comes from placing an actual bill on the table of Parliamentarians to be considered and debated.
Some contronyms have fallen out of usage. At one time, "awful" meant full of awe or awe-inspiring, but now it only means terrible.
An apocryphal story relates how Charles II (or sometimes Queen Anne) described St Paul's Cathedral as "awful, pompous, and artificial", meaning in modern English "awe-inspiring, majestic, and ingeniously designed."
Contronyms are not unique to English. For example, in French, hôte may mean either "host" or "guest."