To add a NPC faction is incredibly complicated, and would require me to type for quite a while. A good way to go about it (And how Disco did it) is instead of making a new one, using one of the NPC factions created for the SP campaign and never used for Multiplayer.
Relationships are changed by an INI in DATA/Missions I believe. It's called Empathy.ini
Freelancer works instead of what ship a faction is flying, it's what faction ships are assigned too. So, a patrol will exist of say 4 defenders, and it will be assigned to ln_n_grp (Liberty Navy). Look under Shipclasses.ini, Formations.ini, Factionprops.ini and npcships.ini.