It depends on the region that they came from, I hate this trope because it is only European from a certain time period in the early medieval era. A lot of people had them but they were common ones like their jobs, or in some regions, their family line was denoted in their name.
Ex. Son = Berg / Father = lettuce / Name = Berg Lettuceson