Middle English mirie, from Old English myrge "pleasing, agreeable, pleasant, sweet, exciting feelings of enjoyment and gladness" (said of grass, trees, the world, music, song); also as an adverb, "pleasantly, melodiously," from Proto-Germanic *murgijaz, which probably originally meant "short-lasting," (compare Old High German murg "short," Gothic gamaurgjan "to shorten"), from PIE root *mregh-u- "short." The only exact cognate for meaning outside English was Middle Dutch mergelijc "joyful."
The connection to "pleasure" likely was via the notion of "making time fly, that which makes the time seem to pass quickly" (compare German Kurzweil "pastime," literally "a short time;" Old Norse skemta "to amuse, entertain, amuse oneself," from skamt, neuter of skammr "short"). There also was a verbal form in Old English, myrgan "be merry, rejoice." For vowel evolution, see bury (v.).
Not originally applied to humorous moods or speech or conduct, yet the word had a much wider senses in Middle English than modern: "pleasant-sounding" (of animal voices), "fine" (of weather), "handsome" (of dress), "pleasant-tasting" (of herbs). The evolution of the modern senses is probably via the meaning "pleased by a certain event or situation or state of things" (c. 1200). Of persons, "cheerful by disposition or nature; playfully cheerful, enlivened with gladness or good spirits," by mid-14c.
Merry-bout "an incident of sexual intercourse" was low slang from 1780. Merry-begot "illegitimate" (adj.), also "bastard" (n.) are in Grose (1785). Merrie England (now frequently satirical or ironic) is c. 1400, meri ingland, originally in a broader sense of "bountiful, prosperous." Merry Monday was a 16c. term for "the Monday before Shrove Tuesday" (Mardi Gras).