The severity and the sheer number of bodies is usually the issue, made worse because teeth and body parts often end up stuck in trees or overlooked in tunnels, so those dead body stressors get refreshed every time they go near them. They don't care at all about animals, but it's things like goblins, trolls, and so forth that they have problems with. Personally, I'd rather they were indifferent and treat it as a fact of life (people die in accidents, wars, or get killed by roaming animals and monsters rather frequently during worldgen after all,) with only the really blood thirsty and hate-prone dwarves enjoying the sight of fallen enemies, and the most bleeding heart pacifistic types getting bent out of shape.
But because battles tend to involve a whole shitload of sapients, y'know, dying horribly, that means dead sapient stressors crowd out and overpower damn near everything short of having children regularly and making artifacts. And dude to how socialization is sort of screwed up right now, getting dorfs hitched to make said stress-reducing babies is a pain in the ass.
It should be noted they can handle cleaning up small, intermittent skirmishes, though you have to watch your soldiers for deterioration of their stress resistance. It's large scale engagements they can't handle, because of the sheer overwhelming number of "Saw an x's dead body" thoughts, which range from the very punishing "horrified," to the more mild, but dangerous-in-large-doses "uneasy" These are exacerbated if you let your dudes get cave adapted and do a lot of fighting topside (so as to keep caravan roads underground clear of debris that might cause wagons to scuttle in fright for instance,) since it'll stack a very nasty stressor (disgusted) on top, and many players deeming it smart for whatever reason to store dead bodies indoors where they can produce stress-inducing miasma (rather than chucking them in a ditch outside or mashing them with bridge if they aren't using or haven't reached magma yet.)
Many dwarves are also prone to apparently seeking retribution for wrongs against thier entity, which leads to many being bombarded with freakishly powerful and very bad "Vengeful" stressors, one per sapient ally in a given fight, if the two tests I ran in the wild were any indication. A large number of vengeful thoughts alone can be enough to make someone go from perfectly happy to "under a great deal of stress" in an instant, even if nobody died and they didn't take part in a fight directly - this was observed when a flock of buzzards attempted to raid my trade depot for recently purchased food. Their repeated attempts causing interruptions in turn caused many vengeful stressors among the half dozen or so haulers they kept pestering, and two were made very stressed out very quickly even though the only casualties were two buzzards a kid killed on a rooftop.
I also think the issue though more stems from the game seeming to prefer to err on the side of "unfavorable" changes to personality, or starting personality in general, leading to more than just the bleeding hearts (as it can be understandable for there to be a handful in a given population,) among your dudes to be super freaked out by the militia or traps literally doing their job. Made even worse by the fact many dwarves have a desire to fight things, and sometimes the local environment just isn't going to be throwing out anything worth your time to kill that wouldn't cause monstrous emotional scarring.
The only way to avoid ever interacting with dead things able to induce mental trauma is to shut off were creatures and vampires, turtle up, and never interact with the outside world (caverns included,) with anything but a bridge-lined hallway and cage trap tunnels, because even animal people, trolls, and trogs will make your dudes freak out if thy see one dead or die. Which is fine if you're shooting for playing a pacifistic fort, but a large portion of players don't enjoy that manner of play style.
It's very, well, boring. And nobody likes having a particular playstyle forced on them, because that's not fun from a gameplay standpoint. DF may be a fantasy world generator, but it also needs to be playable and entertaining to play.
The easiest solution besides simply throwing out your stressed dwarves and hoping they don't come back the next migrant wave (or murdering them a few at a time,) is to simply beef up the stress resistance of whatever you choose to play as so that they can never dip below what is considered "average."
At that area, dwarves can handle intermittent battlefield clean-up and constant rainfall fine, and can still be affected by stress, it just takes much more strain on them at once to make them crack. Another solution is to simply have a huge population to handle the clean up efficiently, so instead of getting bombarded with dozens and dozens of negative thoughts, each individual dwarf is only hammered by a comparative fraction, because everything's been cleaned up in a timely manner (meaning they aren't going to be seeing the same mess of corpses more than a second or third time.)