late Old English cnafa "boy, male child; male servant," from Proto-Germanic *knabon- (source also of Old High German knabo "boy, youth, servant," German knabe "boy, lad"); it is also probably related to Old English cnapa "boy, youth, servant," Old Norse knapi "servant boy," Dutch knaap "a youth, servant," Middle High German knappe "a young squire," German Knappe "squire, shield-bearer." Original sense unknown; Klein suggests the prehistoric meaning might have been "stick, piece of wood." For pronunciation, see kn-.
Sense of "rogue, rascal" is first recorded c. 1200, presumably via sense evolution from "a menial" to "one of low birth," and the low character supposed to be characteristic of such a condition. But through Middle English it kept also its non-pejorative meaning, as in knave-child (Scottish knave-bairn) "male child." In playing cards, "the jack," 1560s.