Origins
The suffix '-ly' is one of the most productive and familiar suffixes in English, used to form adverbs from adjectives (quickly, softly, carefully) and adjectives from nouns (manly, friendly, heavenly). It has a remarkable etymology: it descends from a free-standing Proto-Germanic noun meaning 'body.'
The suffix comes from Old English '-līċ' (adjective-forming, as in 'manlīċ,' manly) and '-līċe' (adverb-forming, as in 'cwiclīċe,' quickly). Both descend from Proto-Germanic *-līkaz, itself derived from the noun *līką meaning 'body, form, likeness.' In other words, the ancestor of '-ly' was a full word meaning 'body,' and the suffix originally meant 'having the body of' or 'in the form of.' 'Manly' is etymologically 'man-bodied'; 'quickly' is 'in the manner / form / body of quick.'
The Old English noun 'līċ' (body, corpse) survives today in the compound 'lich-gate' or 'lych-gate' (the covered gateway of a churchyard where bodies were historically rested before burial). Cognates show the same history: German 'Leiche' (corpse), Dutch 'lijk' (corpse), Swedish 'lik.' The adjective-forming suffix developed from this noun: '-bodied' > '-shaped' > '-having the form of' > the current sense of resemblance.
Development
The adjective-forming '-ly' survives in a smaller, closed set of words, mostly quite old: 'bodily,' 'costly,' 'deadly,' 'earthly,' 'friendly,' 'ghostly,' 'godly,' 'heavenly,' 'homely,' 'kindly,' 'lively,' 'lonely,' 'lovely,' 'manly,' 'motherly,' 'nightly,' 'princely,' 'saintly,' 'worldly.' These are adjectives, not adverbs, and they look exactly like '-ly' adverbs — which can cause confusion. The sentence 'He is friendly' uses 'friendly' as an adjective; you cannot readily say 'He spoke friendly' as an adverb, because '-ly' cannot be stacked on '-ly' (no 'friendly-ly'). Instead, speakers rephrase ('He spoke in a friendly manner').
A handful of words have both adjective and adverb forms in '-ly': 'daily,' 'weekly,' 'monthly,' 'yearly' can all be adjectives ('a daily newspaper') or adverbs ('he visits daily'). These are exceptional cases where the same form fulfils both functions, and they are the closest English has to a single '-ly' suffix serving both roles.
Occasionally '-ly' attaches to numerals ('early,' from Old English 'ǣr' + '-līċe') or nouns ('timely,' 'stately,' 'orderly'). These are historical formations and new ones rarely occur.
Spelling and Pronunciation
A noteworthy feature of '-ly' is that it generally does not attach to adjectives already ending in '-ly' (no 'friendly-ly,' 'silly-ly,' 'likely-ly'). Instead, speakers use periphrastic constructions ('in a friendly way,' 'in a silly manner'). It also sometimes alters spelling: 'happy > happily' (y to i), 'true > truly' (dropping final e), 'whole > wholly' (doubling l), 'due > duly' (dropping final e).
Representative '-ly' adverbs (from adjectives): absolutely, actually, angrily, badly, beautifully, carefully, certainly, clearly, completely, easily, exactly, extremely, finally, fully, generally, gently, happily, hardly, honestly, hopefully, immediately, likely, loudly, mostly, naturally, normally, obviously, often (etymologically different), only, perfectly, possibly, probably, quickly, quietly, rarely, really, recently, regularly, safely, seriously, simply, slowly, softly, suddenly, surely, totally, truly, typically, usually, very (from Latin, not -ly), wholly. Representative '-ly' adjectives (from nouns): bodily, costly, cowardly, daily, deadly, earthly, fatherly, friendly, ghostly, godly, heavenly, homely, hourly, kingly, knightly, lovely, manly, monthly, motherly, nightly, orderly, princely, scholarly, timely, weekly, worldly, yearly.