Probably as often as any other soldier and much in the same way, especially if they're on the losing side.
To clarify, it's not as if archers were somehow naturally weaker than any other soldiers on the battlefield.
Especially in games but also film and other forms of media, archers are often depicted as helpless in close combat. An opponent easily overcome after someones closes in on them and reduces their advantage of range.
But it's naive to believe that archers would come onto a battlefield with no training in hand to hand fighting or lacking some sort of other equipment besides their bows and ammunition.
Especially during early feudal times in Europe or various Asian societies, when army sizes were very small and much of the fighting was done by small groups of professionals (conscription or levy of the common people not a major concept yet), archers would likely pull double duty and would enter the melee at will.
This goes doubly so for Japanese and steppe armies, where archers were more often mounted than not (willfully disregarding the Sengoku Era when massive conscript armies became common).
First of all, archers don't have endless amounts of arrows to shoot. Generally they run out, and sooner than later. Once that happens, they would probably enter the fray, especially in close battles, rather than just sit around not earning their keep.
There is, of course, doctrine and military culture to consider. Archers are a valuable resource in that they generally take a long time to train and equip. It might be more prudent to keep them back where such expensive investments are more or less guaranteed to be safe, though with one caveat. Soldiers you hold back are about as safe as they can be from a frontal attack, assuming your side wins.
As has been said many times by many people, much of the killing in old timey combat occurred after one side routed and men began to run away without discipline to retreat orderly. If this happens, soldiers just become so many targets milling about. Archers are no safer than anyone else in such a situation.
There's also the other chance that the archers were conscripted and are mostly drawn from places where they have experience hunting with the bow and arrow. Though archery is also a sport often practiced by elites, particularly European nobility or Japanese samurai.
In general, archers were no more likely to be killed in any one way than any other soldier on the field. Depending on the specific circumstance, they might have had a better chance of surviving than say, a soldier on the front line of a charge. But factors vary too much from place to place, time to time, and battle to battle for there to be any significant difference.