There are actually two different words keen, although most are only aware of the first and more common one.
Chambers’ Dictionary of Etymology is happy to take keen, in the sense of eager and enthusiastic, back to a proposed Proto-Indo-European root *ǵon- or *ǵōn- meaning to know, also appearing in modern English can and ken (as the song has it, Do you ken John Peel?). It thus made its way through Germanic roots to the Old English céne, which had the most prominent meaning of bold or brave.
However it was already drifting towards wise or learned by the Norman Conquest, and by 1700 was little-used in its former sense, remaining only to indicate sharp and quick intellectual ability.
According to the OED, it was first recorded being applied to a sharp blade, with a keen edge, in 1225, and although that is now largely confined to the phrase a keen edge, it has stuck.
From there, presumably, it has moved on to mean piercingly cold, usually as a keen wind, which is biting. It has also transferred to acrid tastes, sharp or piercing sounds, and other similar sensations, or anything which might cause acute pain or distress.
When applied to people, it came to mean eager or desirous from the fourteenth century, and that has become its most common and everyday use. That has also spread to the senses, particularly vision and hearing, which are keen when particularly sensitive, usage which seems to have displaced earlier more unpleasant sensory connotations.
When applied to prices, it means competitive, a usage which seems to have arisen in the nineteenth century and is now common.
Colloquially at the start of the twentieth century (the OED gives 1914 for an early appearance) it has seen a further, perhaps stranger, shift to mean very nice, wonderful, or splendid.
Surprisingly keen has seldom been verbalised, in the sense of to render keen or to sharpen, something which seemed to pass in the middle of the eighteenth century.
One formulaic use of the word keen is in the popular simile as keen as mustard, recorded in 1675. Given the choice of meanings and its origin above, it is not hard to see the influences which must have led to its coining. However the phrase was also taken up in the eighteenth century by a firm named Keen who manufactured mustard, and has given rise to some erroneous derivations, as described here.
So much for the first sense of keen, but what of the other?
Here derived from the stem of the Irish (Gaelic) verb caoin- to wail, it became a transitive or intransitive verb meaning to utter or wail a lament for the dead, recorded from the early nineteenth century in the word keener, a wailing mourner, and the noun keen, the lament itself.
I suspect its ultimate origin is probably onomatopoeia, but am ready to be corrected.
(Here keener is not to be confused with a US use of the other keener, meaning someone who drives a hard bargain, or someone or something which is superior. I do not know whether the latter is still in use.)
So from a brave king, to the pungent taste of mustard, with a wail on the side – all in the one word keen.