"having a sharp taste," late 14c., perhaps from Old English teart "painful, sharp, severe" (in reference to punishment, pain, suffering), of unknown origin; possibly related to the root of teran "to tear." Figurative use, with reference to words, speech, etc., is attested from c.1600.
"small pie," c.1400, from Old French tarte "flat, open-topped pastry" (13c.), possibly an alteration of torte, from Late Latin torta "round loaf of bread" (in Medieval Latin "a cake, tart"), infl. in Middle English by tart (adj.).
"prostitute," 1887, from earlier use as a term of endearment to a girl or woman (1864), sometimes said to be a shortening of sweetheart. But another theory traces it to jam-tart (see tart (n.1)), which was British slang early 19c. for "attractive woman." To tart (something) up is from 1938.