"fee to secure services," mid-15c., originally "act of keeping for oneself" from retain, or perhaps from or influenced by Middle French retenir, infinitive used as a noun. Meaning "fee paid to an attorney to secure his services" is from 1818.[retainer etymology, retainer origin, 英语词源]
"servant," 1530s, agent noun from retain (v.). Also "one who retains or holds" (1540s). Meaning "dental structure used to hold a bridge in place" is recorded from 1887.