Both.
Basically NPCs will have wants/needs and they will also have skills available to them. If a town has an open farm and a NPC has farming skills there is a chance the farmer would approach the owner of the farm and ask to buy it/rent or work it.
As the entire world is procedurally generated before players even arrive all positions will be held by NPCs and these npcs will continue to hold those jobs until a player takes them over or they get angry and lose favor with their boss and move on.
Just keep in mind for a npc to sign a contract they have to initiate it. The AI won't be smart enough to weigh custom contract clauses so rather than allow players to scam/exploit the AI, contracts between players and NPCs have to be NPC initiated.