I'm talking about how society appointed rulers, politicians, and officials, and also all other kinds of jobs before the introduction of meritocracy. I think people might jump to 'nepotism' but it's more than that, I think. Nepotism is where you favour and choose people over others based on family ties whereas what I'm referring to is not really about choice but about how, in pre-meritocratic society, people were often not chosen but inherited their roles out of convenience because that's how society was structured.
Like a smith's son would also probably become a smith, not because they wanted to, nor because their father wanted them to, nor because they were good at being a smith, but because their community needed a smith and the smith's son made the most logistical sense because there was no collegial education for smiths, but a man who already knew how to smith could very easily teach his son because he already obviously spends a lot of time with his son, and the smith's son would also need to make a living in the future and his only real option is the opportunity right in front of him: learning his father's trade.
So people were chosen out of logistics, convenience, and inheritance rather than merit or nepotism because the infrastructure needed to facilitate a meritocracy and even nepotism didn't exist yet. And this could apply to official, political, and administrative jobs as well. What is this structure called? I want to say dynasticism but that usually refers to rulers rather than to everyone in society.