Hi, surname practices vary widely, so to get an answer that will be meaningful to you, it would be best if you could specify a country/culture. I'm going to guess that by using the example "Thompson" you mean England, so you may be interested in /u/lord_mayor_of_reddit's answer here:
Well, in terms of Nordic peoples I can speak to this. Largely you can thank urbanization Surnames were typically the father's name i.e. Thorsson or Jansdottir. Son for a male child and dottir for a female.
This started to heavily change in most Nordic places (other than Iceland, where it is still practiced limitedly to this day) during the times of urbanization. One country where this is most regulated is Sweden where the Name Ordinance of December 5, 1901 created an organization to ensure lesser folk didn't take the names of Nobles - who were among the first to stop using the father's name on a revolving basis as their last name for ruling and inheritance reason - and instead kept a unified family name. So we'd know they were all special!
All this is to say in Scandinavia historically there were no last names. These were made up as populations grew and grew closer together requiring more differentiation than before. So people took names of the farms the worked at: Moen (meadow) or the job they held Fisker (Fisher) or just items from nature like Berg (mountain) or military names became common like Skarpsvärd (sharp sword). Or for the less creative Larsson (Lars' son). So instead of looking for a Thor in town, you could easily find Thor The Fisher, Thor Son of Lars, Thor by the Mountain or Thor the Sharp Sword.
Honestly, this all really amounts to population growth leads to more people and a better way to quickly tell them apart. Urbanization.
Same goes for not using the father's first name. As the number of people grew it simply became too confusing for the government and others to keep track of the old ways - and most nation's brought this to law in the early 1900's.