The story
The adverb is derived from happily (adverb) + ever after (adverb), used as a formulaic ending in works for children especially since the 19th century. The noun is derived from the adverb.
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: Chiefly preceded by he, she, they, etc., lived: often used as a formulaic ending in fairy tales, stories for children, and similar works: in a state of happiness for the rest of his, her, their, etc., lives. Full definition →
The adverb is derived from happily (adverb) + ever after (adverb), used as a formulaic ending in works for children especially since the 19th century. The noun is derived from the adverb.
Etymology from Wiktionary, CC BY-SA 4.0.