"true or faithful in allegiance," 1530s, in reference to subjects of sovereigns or governments, from French loyal, from Old French loial, leal "of good quality; faithful; honorable; law-abiding; legitimate, born in wedlock," from Latin legalem, from lex "law" (see legal).
Identical with legal, which maintains the Latin form; in most uses it has displaced Middle English leal, which is an older borrowing of the French word. For the twinning, compare royal/regal. Sense development in English is feudal, via notion of "faithful in carrying out legal obligations; conformable to the laws of honor." In a general sense (of dogs, lovers, etc.), from c. 1600. As a noun meaning "those who are loyal" from 1530s (originally often in plural).
-ly 2
common adverbial suffix, forming from adjectives adverbs signifying "in a manner denoted by" the adjective, Middle English, from Old English -lice, from Proto-Germanic *-liko- (cognates: Old Frisian -like, Old Saxon -liko, Dutch -lijk, Old High German -licho, German -lich, Old Norse -liga, Gothic -leiko); see -ly (1). Cognate with lich, and identical with like (adj.).
Weekley notes as "curious" that Germanic uses a word essentially meaning "body" for the adverbial formation, while Romanic uses one meaning "mind" (as in French constamment from Latin constanti mente). The modern English form emerged in late Middle English, probably from influence of Old Norse -liga.