To create a new faction, you'd need to change entity's type to a new type. Then you need to modify other factions to be able to hostile toward and damage that new faction.
That sounds too technical so I'm going to give example of creating 2 factions

.
1st faction is the enemy and the 2nd faction is new faction. Both factions are hostile toward players and NPC and they can damage both of the latter.
First, you need to set this in enemy''s texts:
Code:
onspawnscript data/scripts/faction1.c
This is
faction1.c :
Code:
void main()
{
void vSelf = getlocalvar("self");
changeentityproperty(vSelf, "hostile", 2048 + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_NPC") );
changeentityproperty(vSelf, "candamage", 2048 + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_OBSTACLE") + openborconstant("TYPE_NPC") );
changeentityproperty(vSelf, "projectilehit", 2048 + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_OBSTACLE") + openborconstant("TYPE_ENEMY"));
}
Second, set this in new faction's text. This new faction entity could start as enemy type but onspawnscript will change that.
Code:
onspawnscript data/scripts/faction2.c
This is
faction2.c :
Code:
void main()
{
void vSelf = getlocalvar("self");
changeentityproperty(vSelf, "type", 2048);
changeentityproperty(vSelf, "hostile", openborconstant("TYPE_ENEMY") + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_NPC") );
changeentityproperty(vSelf, "candamage", openborconstant("TYPE_ENEMY") + openborconstant("TYPE_PLAYER") + openborconstant("TYPE_OBSTACLE") + openborconstant("TYPE_NPC") );
changeentityproperty(vSelf, "projectilehit", 2048 + openborconstant("TYPE_OBSTACLE") + openborconstant("TYPE_ENEMY"));
}
To test this, spawn both enemies and new factions in one level and see how they'll react to each other

You (as player) can join in too.