Currently enemies run out. Necro towers deplete from losses against you, and won't fill up again until you retire (at least they didn't for 70 years, but when I checked a few years later while reclaiming the mountainhome the necro towers had repopulated).
Goblin invaders unfortunately don't know how to use reinforcements, so they attack you from one settlement and continue to attack you from that settlement alone until they run out of bodies. In that same fortress they depopulated a small settlement and then actually repopulated it very slowly over the next 65 years or so, attacked twice again and lost half their forces each time, so they gave up again when they were down to 7 or so. And the later ones were recruits, i.e. unarmed and unarmored, so it wasn't exactly any fights.
All goblin civ collapsed as well. The one that attacked me lost the settlement it attacked from in the second year (to another goblin civ), but kept sending hello/goodbye sieges for another 6 years. The civ then went completely site and pop less, but still attacked from that small site, which was owner less at the time of the later sieges. The last goblin civ died as its 3 remaining members (all humans) died of old age. Note that the goblins weren't in trouble as a race (27000 goblins and a sum of 500 or so of the other races), but they all lived in sites that were outside of any civ's control.