ace (n.) Look up ace at Dictionary.com
c. 1300, "one at dice," from Old French as "one at dice" (12c.), 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]; source also of Spanish as, Italian asso, German ass, Dutch aas, Danish es), perhaps originally Etruscan and related to Greek eis "one" (from PIE *sem- "one, as one"), or directly into Latin 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 often is 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 "point scored" (1819) led to sense of "unreturnable serve" (by 1889).
ace (v.) Look up ace at Dictionary.com
"to score" (in sports), 1923, from ace (n.). This probably is the source of the student slang sense of "get high marks" (1959). Related: Aced; acing.