c.1300, "one at dice," from Old French as "one at dice," from Latin as "a unit, one, a whole, unity;" also the name of a small Roman coin ("originally one pound of copper; reduced by depreciation to half an ounce" [Lewis]), perhaps originally Etruscan and related to Greek eis "one" (from PIE *sem- "one, as one"), or directly from the Greek word.
In English, it meant the side of the die with only one mark before it meant the playing card with one pip (1530s). Because this was the lowest roll at dice, ace was used metaphorically in Middle English for "bad luck" or "something of no value;" but as the ace is often the highest playing card, the extended senses based on "excellence, good quality" arose 18c. as card-playing became popular. Ace in the hole in the figurative sense of "concealed advantage" is attested from 1904, from crooked stud poker deals.
Meaning "outstanding pilot" dates from 1917 (technically, in World War I aviators' jargon, one who has brought down 10 enemy planes, though originally in reference to 5 shot down), from French l'ace (1915), which, according to Bruce Robertson (ed.) "Air Aces of the 1914-1918 War" was used in prewar French sporting publications for "top of the deck" boxers, cyclists, etc. Sports meaning of "point scored" (1819) led to that of "unreturnable serve" (1889).