Many people—native-speakers and learners alike—decry English as being illogical, and they point to pairs like flammable and inflammable as examples. But there are other words that are just as frustrating: contronyms.
Frequently described as "words that are their own opposites," contronyms (contranym is a variant spelling) are also known as Janus words, antagonyms, and autoantonyms. These are words that have developed contradictory meanings. Cleave is often cited as the go-to contronym: it can refer to splitting something apart and to uniting two things. Those disgruntled at the phenomenon may be glad to know that the class of words is rather small, and also that there is usually some sort of logic at work.
Many contronyms developed their contradictory meanings through semantic broadening, a process by which a word with a narrow, specific meaning gains a broader and more general meaning later on in its life. Peruse is a good example of this.
The inverse also happens: a word that begins life with a broad meaning gains a number of more specific meanings that develop in parallel to each other, but in a way that eventually results in contradictory meanings. Sanction is one such word. When it entered English, it referred to an oath. Over time, it came to refer to something that would compel someone or something to moral behavior, as an oath might; later, it gained the two contradictory senses that refer to approval and economic disapproval—both of which might compel a person or a country to behave better.
The same thing happened with oversight. That word originally referred to watchful care or supervision, but through an extension of meaning, people also began to use it to refer to the thing that watchful care or supervision gets rid of: errors of omission. As with sanction, both meanings are still in use today, leading to plenty of jokes about what exactly "Congressional oversight" refers to.
Sometimes, a contronym develops because we conflate two homographs which are not actually related. This is the case with cleave, which is actually two separate verbs: one which means "to split" (from the Old English verb cleōfan, which means "to split"), and one which means "to adhere firmly or loyally" (from the Old English verb clifian, "to adhere"). The same goes for clip, whose contradictory meanings are actually from two discrete verbs that mean "to attach something" and "to cut off."
Occasionally, we can't be sure why exactly a word develops contradictory meanings. Take fast, which can describe quick movement ("a car moving really fast") and lack of movement ("a box held fast by ropes"). The "firmly fixed" meaning is the earliest meaning we have for the adverb fast. It later developed other meanings, among them "close"; this meaning, which has now fallen out of use, somehow inspired English speakers to use fast to refer to speed. Fast has been its own antonym since the 13th century, which goes to show that contronyms have been with us—and will continue to be with us—for a long time.