There are some people who can, and do, pre-create factions and NPC clusters and reasons for people to act as they do. They put the work in to make things real and believable, to give them depth of reasoning as soon as you interact with them.
I am not one of those people. My usual prep consists of writing down the name of some NPCs if the group is going to a new area. However, sometimes you need more than that. So, let me introduce you to the method I use: it’s called Seat of the Pants Factioning. The essential thing here is to have players who will ask questions. Then you answer them, and that the facts of the campaign. Every time you make an answer, there’s a possible opposite to it as well, which someone else wants or believes.
I know approximately what the tensions in the Richberry Clan are right now. I just have no idea who believes what about parts of it. I know that there are a few pro-Lunar people, and that there is even a Lunar who lives there. I know that a lot of the pro-Lunar leadership died recently. There are people who want the clan to join with the Zethnoring to keep them both in the Locaem, and people who want to go to war with the Colymar, so the Zethnoring don’t leave. There are people whose feuds with the Enjossi are a problem, and people who want to end that fight.
I’ve found I need to start with an existing tension that’s easily discovered and explicit. I’ve often got two groups of people who want something different from the PCs. Most recently there’s a bunch of warriors who want the sister of their missing chief to rule, and then there’s the law-giver and scribe who wants the sister to go and find some relatives of her (and therefore the chief’s) so they can be tested to find out if they are chief material.
The thing about having the existing tension is that any time you need to pause to have an idea, one of your original NPCs that you already understand can break in, and give you time to think. Assign a tension to one of the people they know or bring in a new person to bring in a tension. “Well, we can’t raid the Zethnoring this year. We want peace.” vs “If we don’t raid someone, then we’ll be targets for everyone, and the Zethnoring are the only people not really of the tribe, so it makes sense to take their cows before they leave.” That way, you build a web of interests as you go, but you never do a lot of work that will go unused. As far as the PCs go, it’s coherent. It fits together because you know what the tensions might be – you just don’t know who needs to believe what until someone goes looking.