Here's how it evolved:
* Old French: "cape" (meaning "cloak", "hood", or "head covering")
* Middle English: "cap" (meaning "head covering")
Interestingly, the word "cape" itself is derived from the Latin word "cappa" which meant "cloak" or "hood".
So, while we use "cap" today to refer to a head covering, its roots lie in a word that originally meant a more extensive garment.