The Old English word fast meant constant and secure. From this root we get words like steadfast, a fastener and fasten. [also more uncommon words such as holdfast, headfast, lockfast (Scots English only) and shamefast] Also one use of the word fast as a verb (action) was to have firm control of oneself and was used to describe voluntarily not eating, usually for religious reasons. Not eating by choice is a fast. Which is of course where we get the word breakfast, meaning to break one's fast.
The quickly meaning for fast may have existed in Old English. The word fast did have both meanings firmly and quickly in Old Norse. The change in meaning seems to come from the idea that a person that is fast is firm and strong, if they are strong they can run vigorously and quickly. So a fast man implies one who can run quickly. The word fast in this sense may have been one of the many words that were added to English after the Norse invasion. (The Viking share of the English Language and An Unsung Hero)
The old sense of the word fast meaning firm and secure is still in use. A rule that is hard and fast is always enforced without changes. To hold fast to something is to hold on tightly and without letting go. To stand fast is not to move, even if threatened. When one glues something, one wants it to stick fast.
Just as you think you have understood a simple English word, the messy history of English drops you into the deep end of the language lake. Beware of the dragons.