TL;DR (edited): Last names were not necessarily inherited and may not have been literal. In English, in the time when last names were mostly inherited, it has been suggested that such names are likely to have been nicknames. But sometimes it's a related phrase like "servant of the _" or "at the _'s" that has lost the designator, and occasionally it really does mean "child of the".
My handy sources are English, and it's what I'm most familiar with. I have the English translation of Hans Bahlow, Dictionary of German Names, if you want that. For other languages, I'd have to talk to onomasochists that I know.
"Most are related to profession" is not warranted by number of names in English, but I don't know about frequency of use (there may have been many more people named Whitesmith than Atwood). A significant number are locative (e.g., Grafham, from a town in Sussex or Huntingdonshire), descriptive, or nicknames (e.g., Grant or Grand, may be "great" as in manners, "elder", or "tall").
I'll take these examples from P. H. Reaney and R. M. Wilson, A Dictionary of English Surnames, 3rd ed. (Surname = last name)
Monk, Monck, Monnick, Munck, Munk, p. 312: earliest citation Aylric Munec c. 1045, latest Richard le Monk 1327. "Old English munuc, munec 'monk', originally occupational, later a nickname".
Abbatt, Abbett, Abbitt, Abbot, Abbots, Abbott, Abbotts, Labbet, p. 1: earliest Walter Abbot 12th C; latest Ralph Abbod 1272. "Old English abbod, late Old English abbat, abbot, 'abbot'. Early Latin examples such as Alfwoldus abbas 1111-17 are names of actual holders of the office of abbot and can hardly have given rise to surnames. Later examples are nicknames."
Pope, p. 358: Agnes and Hugo le Pope c. 1230; Henry Pope 1296. "Middle English pope from Old English p{a-}pa, v. PAPE".
Pape, p. 337: whether from Old English p{a-}pa or Old French pape, they both mean "pope". "A nickname for one of an austere, ascetic appearance, or a pageant-name."
Deaconson, p. 128: certainly no later than the Second Lateran Council, in canon vii, deacons could not licitly marry, but Rainale filius decani is attested (edit: no date given), and John Deconson is attested in 1374. Maybe not originally a legitimate heir, but they might be known as it.
Nunn, Nunns, p. 325: "Where the christian [= first] name is that of a woman, this is a surname of office. Applied to a man (as most commonly [if for no other reason that men tended to show up more in records]), it is a nickname for one meek and demure as a nun". But also Robert del Nunnes, othe Nonnes 1297, John atte Nunnes 1325. "'Servant at the nuns', identical in meaning with Nunhouse and Nunman". Their header names refer to modern derivatives of the names they cite, so they're saying that along the way, in the second case, the descriptives like "of the", "of the", "at the" were lost, as was often done in English.
Bishop, Bishopp, Bisshopp, p. 46: they cite the given name Biscop to Domesday Book 1086, Bissop 1195, Bissop atte Combe 1327, from the Old English name Bisc(e)op. Unmarked patronymic names are well-attested. (Edit, translation: In English, there are many cases where the last name is the father's name without a marking.) But they also cite Thurstan le Byssop 1240 and Thomas le Byscop 1297: "or a nickname for one with the appearance or bearing of a bishop, or a pageant-name from the custom of electing a boy-bishop on Saint Nicholas's Day".
Priest, Preist, Prest, Prestt, Press, Prust, p. 362: I see now I should have led with this. {AE}lfsige Preost 963 is presumably "in early examples denoting office". And they go on with the usual, "but later usually a nickname for a man of 'priestly' appearance or behavior or, no doubt, often for one of a most unpriestly character, v. PRESTER". "As with Parsons and Vickers, we also find forms with an elliptic genitive [meaning a possessive, like "'s"] and with -son". Cristina Prestes 1327 'servant of the priest'. Thomas Prestson 1332 'son of the priest', Thomas fiz al prestre 1230 meaning the same. Though these last two "do not seem to have survived". Sarra atte Prestes 1327 'servant at the priest's'.
Prophet, p. 363: guess.
Under Holyfather p. 236 are attested some amusing cases, but also Richard Holigost 1354 'holy spirit', and that's not going to be an inherited name.
EDIT:
As well, there can names that have misleading appearance. Lovegood, p. 285, "The variation in the vowel points to a first element L{e-}of-, hence from Old English L{e-}ofgod 'beloved god or good', a rare Old English personal name". Sexy, p. 402: Sexi Forfot 1137 and Warin filius Sexhiue 1185 shows that's it just a given name, Old Norse Saxi / Sexi, or possibly from an Old English compound. And it became an unmarked patronymic.
I need to add grains of salt about the nickname suggestion. I find that Wilson's preface to the third edition of the source says "Similarly the etymologies suggested are usually my own, and from the nature of the surnames included tend to be either obvious or highly speculative".
Names like Deaconson and John atte Nunnes are reasonably solid.
For the suggestions that a surname is a nickname based on appearance or manners ... well, nicknames were one of the common sources of last names in England: Black, Proud, Low (from either "low" or Old French "lou" "wolf", or a place-name). We can be confident that these are nicknames because there are versions with "le" or "þes", "the". Some of the citations I provided have a form of "the". Some of these sources are from contexts, like assize rolls, where it might well be noted if the person actually was an abbot. It's hard to see an explanation for Pope in England other than as a nickname.
But in general, I think his suggestions that they're nicknames for such-and-so a reason are not 100% certain, and I suspect they suggest it because it's plausible plus lack of another evident possibility (no placename they know of or no mutation).
To sum up the question: "If surnames are passed down to children and most are related to profession (Smith, Farmer, Cooper), how do names like Monk, Abbott, and Pope exist". Nicknames (and placenames and given names) were also sources of last names. And English last names sometimes lost their markers, and despite canonical prohibitions, clerics would go about having children sometimes.
Related question if I may: how do so many white German people have the name Schwarzman (literally Black Man) or Schwarz? I was just wondering that the other day and thought it was interesting.
There is also places where there godfather would name a child. Usually not the first born.