My theories on that are pretty mundane. Periodically during worldgen, the question is asked "Is this population centre going to attack this other population?" A random value is requested and (according to how warlike the various parties are) may or may not exceed the threshold. If it does, "a battle is arranged". The invader population's details are used to provide the actual invading force, the defending population's details may involve a primary defence force but possibly all members get involved.
There's some quick 'rounds' where attacks and defending moves are compared (in both directions), as a war of attrition, until the attacking side is below a certain amount of attackers (and will retreat home), or the defending side is below a certain amount of defenders (and will flee, possibly to augment other settlements), or it goes down to the wire and the death of every individual on the losing side.
If the attacker succeeds, they are now left 'running' the attacked site, otherwise the (reduced?) defending population retains it.
Have you never played a table-top wargame? It'll be something like that. Only done very quickly inside the computer.
And as both the pre-cursor to the battle and the battle itself is dependant upon a seeded PRNG, the same seed (in a world with the same geology) will mean that the same battles occur and the same outcomes does, because each request for a random number made in a re-run is (on the spot) calculated in exactly the same way as the random number requested during the previous run. I assume. I've not messed with History Seeds much, for all I know other perturbations creep into this process. Certainly if you changed the geology seed, I could see different battles being fought (with different physical distances between settlements, indeed, different settlements altogether!), and thus different choices needing resolving during the course of history.