late Old English smeart "painful, severe, stinging; causing a sharp pain," related to smeortan (see smart (v.)). Meaning "executed with force and vigor" is from . Meaning "quick, active, clever" is attested from , from the notion of "cutting" wit, words, etc., or else "keen in bargaining." Meaning "trim in attire" first attested 1718, "ascending from the kitchen to the drawing-room " [Weekley]. For sense evolution, cf. sharp (adj.).
In reference to devices, the sense of "behaving as though guided by intelligence" (. smart bomb ) first attested 1972. Smarts "good sense, intelligence," is first recorded 1968. Smart cookie is from 1948.