c. 1200, "spiritual credit" (for good works, etc.); c. 1300, "spiritual reward," from Old French merite "wages, pay, reward; thanks; merit, moral worth, that which assures divine pity" (12c.) and directly from Latin meritum "a merit, service, kindness, benefit, favor; worth, value, importance," neuter of meritus, past participle of merere, mereri "to earn, deserve, acquire, gain," from PIE root *(s)mer- (2) "to get a share of something."
Sense of "worthiness, excellence," is from early 14c.; from late 14c. as "state or fact of deserving, condition or conduct that deserves either reward or punishment;" also "a reward, benefit." Etymologically it is merely "that which one deserves," and the Latin word was used of rewards or punishments, but in English it has typically meant "state or fact of deserving well."
Merits, in law, is "the right and wrong of the case, essential facts and principles" (as distinguished from questions of procedure, etc.). In civil service promotion, the merit system is attested by 1880 (opposed to the spoils system); the phrase was used earlier in other contexts. Merit-monger (1550s, Latimer) was a common 16c.-17c. term of theological contempt for one who believes that human merit entitles man to divine rewards.
late 15c. (Caxton), "to be entitled to, be or become deserving of, earn a right or incur a liability," from French meriter (Modern French mériter), from merite (n.), or directly from Latin meritare "to earn, yield," frequentative of merere, mereri "to earn (money);" also "to earn pay as a soldier" (see merit (n.)). Related: Merited; meriting.