1730, shortening of cadet (q.v.); originally used of servants, then (1831) of town boys by students at Oxford and English public schools (though at Cambridge it meant "snob"), then "townsman" generally. Compare caddie. Meaning "person lacking in finer feelings" is from 1838.
A cad used to be a jumped-up member of the lower classes who was guilty of behaving as if he didn't know that his lowly origin made him unfit for having sexual relationships with well-bred women. [Anthony West, "H.G. Wells: Aspects of a Life," 1984]