c. 1200, flateren, flaterien, "seek to please or gratify (someone) by undue praise, praise insincerely, beguile with pleasing words," from Old French flater "to deceive; caress, fondle; prostrate, throw, fling (to the ground)" (13c.), probably from a Germanic source, perhaps from Proto-Germanic *flata- "flat" (from PIE root *plat- "to spread").
"Of somewhat doubtful etymology" [OED]. Liberman calls it "one of many imitative verbs beginning with fl- and denoting unsteady or light, repeated movement" (for example flicker, flutter). If it is related to flat the notion could be either "caress with the flat of the hand, stroke, pet," or "throw oneself flat on the ground" (in fawning adoration). The -er ending is unusual for an English verb from French; perhaps it is by influence of shimmer, flicker, etc., or from flattery.
Meaning "give a pleasing but false impression to" is from late 14c. Sense of "show (something) to best advantage" is from 1580s, originally of portraits. Related: Flattered; flattering.