The biggest difference/innovation as of late is inverting the trench, bringing the dirt/sandbags above ground instead of the soldiers below ground
Anything involving modern combined-arms warfare. Iraq, for example.
Still, I believe earthen barriers are still used to solidify the 'frontlines' if you squint a bit
Afaik the Iraq Iran war was still doing straight up trench warfare (at points) and the Syrian civil war + Afghan theater were using caves (in some areas). Same with Korea and Vietnam.
Then again you're right in that I don't think sudan etc have used trench warfare (in the first civil war, apparently the second one has on a post edit search: https://www.bbc.com/news/world-africa-65962771 )
You're completely right on the second Iraq war, I don't see any sources for trenches, minus hesco.
I think what I comes down to is trench warfare is popular for the same reason earthworks are popular in civil engineering. Cheap, locally sourced, and effective in its purpose.
Static versus combined arms. The U.S. military is deadly not only because it is big, but also because it practically invented and then mastered modern combined-arms warfare. (It’s why we put so much emphasis on air superiority over e.g. armour.)