I think it's probably something along the lines of, determine how many hitpoints the planet has due to population, add 100 per facility, then randomly distribute among that range. It might be a different number, but I seem to remember that being the number of "extra" hitpoints once population was accounted for. That's the only thing that I can think of which would explain what I remember seeing, which is that usually facilities are destroyed in proportion to the population, but sometimes several are destroyed early, and sometimes you will have a 0M population colony with a facility left (meaning last 100 damage).
But remember, sometimes it's just more fun to lob a MOAB at an inhabited world
