late 12c., "to render habitual obedience to," also "minister, give aid, give help," from Old French servir "to do duty toward, show devotion to; set table, serve at table; offer, provide with," from Latin servire "be a servant, be in service, be enslaved;" figuratively "be devoted; be governed by; comply with; conform; flatter," originally "be a slave," related to servus "slave," which is of uncertain origin.
Perhaps from Etruscan (compare Etruscan proper names Servi, Serve, Latinized as Servius), but de Vaan says it is from Proto-Italic *serwo- "shepherd," *serwā- "observation," from PIE *seruo- "guardian" (source also of Avestan haraiti "heeds, protects"):
Rix 1994a argues that the original meaning of *serwo- probably was 'guard, shepherd', which underwent a pejorative development to 'slave' in Italy between 700 and 450 BC. Servire would be the direct derivative of servus, hence 'be a slave'; servare would in his view be derived from an older noun *serwa- or *serwom 'observation, heedance'.
By c. 1200 also as "to be in the service of, perform a service for; attend upon, be personal servant to; be a slave; owe allegiance to; officiate at Mass or other religious rites;" from early 13c. as "set food at table;" mid-14c. as "to wait on (customers)." From late 14c. as "treat (someone or something) in some fashion."
To serve (someone) right "to treat as he deserves" is recorded from 1580s. Sense of "be useful, be beneficial, be suitable for a purpose or function" is from early 14c.; that of "take the place or meet the needs of, be equal to the task" is from late 14c.; that of "suffice" is from mid-15c. Meaning "render active military service" is from 1510s. Sporting sense, in tennis, badminton, etc., first recorded 1580s. Legal sense "present" (a writ, warrant, etc.), "give legal notice of" is from early 15c.
He no schuld neuer wondTo seruen him fro fot to hond["Amis and Amiloun," c. 1330]
1680s, in sports (tennis, etc.), from serve (v.).