c.1300, "base or low-born rustic," from Anglo-Fr. and O.Fr. villain
, from M.L. villanus
"farmhand," from L. villa
"country house" (see villa
"The most important phases of the sense development of this word may be summed up as follows: 'inhabitant of a farm; peasant; churl, boor; clown; miser; knave, scoundrel.' Today both Fr. vilain and Eng. villain are used only in a pejorative sense." [Klein]
Meaning "character in a novel, play, etc. whose evil motives or actions help drive the plot" is from 1822.