I wrote an automatic teambalancer for Titanfall 2 Northstar, that solved a lot of proplems that match balancing was having before I made it.
Now it's the go-to for making sure teams are even on a server. It takes into account a lot of things that might screw up balance, and is even able to actively compensate if players suddenly leave/join.