Previously, I have shared some thoughts on writing characters and writing worlds. This time, I thought it would be a good idea to talk a little about factions, which is another part of world building. Depending on the kind of story you are making, you will need factions. I would define factions as groups of individuals that have a common goal and are at odds with other factions. For example, elves and orcs would be different factions, although I'd say factions belong to any kind of setting, not just fantasy.
What kind of stories would require factions? Usually, stories about conflict where you have groups fighting each other for any specific reason, like world or universe domination, resources, etc. (even a single character could result in a conflict, for example, a princess being captured and a war between groups starts to rescue her).
Taking Dune as an example, again, you have the House Atreides, the House Harkonnen, the Fremen, Ixians, the Corrino, etc., etc. All of them have a similar goal, but each one has a different modus operandi and set of rules or codes. I would argue writing factions would be similar to writing a world, because you need to have a clear set of rules as to what every faction is supposed to be, even if those rules are never mentioned in the story. In fact, I'd say they don't need to be mentioned in the story, but they need to serve as a guide when shaping the actions all the different factions take.
Also, factions can be made up of beings of the same race or species, or different ones depending on your need, and there's no reason to limit yourself to one or the other. A faction made of beings of one species could be interesting if you have a clear idea of why they are a homogeneous group, but also a faction could be made of different races or species if they have a common ground in other areas. For example, the Star Fleet in Star Trek included different species, while other groups were composed only of members of the same species.
For example, imagine a faction that has a “no survivors” motto (among other things, of course). It wouldn't make sense for them to leave survivors at some point, but it would be very interesting to have one of them to spare some people if that is used in the story somehow. However, there are obviously a lot of things to consider when creating a faction, not just a few rules here and there. I'd argue you need to take as much care for this as the rest of the world building, so you can have something that makes sense and, more important, is interesting. Things like religion (or lack of), modus operandi, philosophy, goals, etc., are things to keep into consideration.
When creating your factions, it's perfectly normal to shape them after a group in the real world. However, I'd argue against making a copy-paste of a real world group because that is going to make your story boring (regular people don't look for fictional media to read about a re-creation of the real world) and also because that will greatly impact the freedom of your story because you have to stick to what the real world group would do, and that may go against your entire story, world or characters.
At the end of the day, if your story is set in space but you can change the setting for present-day country X, or the wild west, or medieval Europe, without changing the characters or factions, that's bad writing and your world building is purely cosmetic.
In the beginning I said factions were not mandatory, but rather something you may need. Factions don't replace characters (unless you only need factions rather than individual characters, like real time strategy games, simulators, etc.). Sometimes you will have factions and a main character, and that is perfectly OK. The character will be part of a faction (or someone working solo), and presenting that is part of your work. Likewise, if your character is the unnamed hero (blank slate), you also need to take that into consideration.