Air-burst rounds beat trenches.
Armor piercing rounds beat tanks (and bunkers).
So the solution: have tanks next to your trenches. If your opponent loads air-burst rounds into their weapon, charge at them with your tank.
If your opponent loads armor-piercing rounds into their weapon, run into the trench. Armor-piercing (neither HEAT nor Sabot) can do much vs a trench. (I'm ignoring the AC-130, just assuming land-based combat for now cause AC-130 is beaten by a totally different strategy: air superiority)
---------
"Combined arms". Your opponent has to load his weapon with the right bullet for the right circumstance. Mix up your strategies (both defensive and offensive strategies).
* HEAT-armor piercing loses to reactive armor on a tank.
* Reactive-armor loses to sabot-rounds.
* Sabot rounds lose to long-distance battle (air-resistance slows down the round). HEAT is better at long-distance (HEAT always was kinda slow: most of the "power" comes from the explosion that occurs after-the-collision... which is beaten by reactive armor).
You can't guard against everything. Instead, you rely upon mixing up the strategies enough so that enemies are kept "guessing" as to which weapon to load / unload.
What the US Military does, is combine a force of an M1 Abrams + M2 Bradley IFV, maybe with a M109A6 Paladin self-propelled armored Howitzer and a cell-phone that can call an AC-130 if things get really bad.
Each machine is designed for a different situation. For the trench, the M2 Bradley IFV has the ability for anti-trench air burst rounds... and the M109A6 Paladin classic "artillery" can lob explosives at a very high angle and probably hit any trench from miles away.
------------
M2 Bradley IFV can take a trench: it has grenades, air-burst weapons, machine gun, missiles and more. M2 Bradley IFV has thinner armor however. So the M2 Bradley fighting by itself is still not the best option: if the opponent has a 100mm anti-armor gun in their trench, they may kill the M2.
M1 Abrams can't take the trench, but it can lend its armor to the M2 by driving in front of it: blocking those anti-armor shots and making things safer for the M2. The air-burst attack can likely be done from behind an M1's cover.
------------
If you know the enemy will only send M2 Bradleys, you simply set up bunkers (covered above-grade concrete structures) with anti-armor cannons. Bradleys only have a 30mm gun, so you can build concrete + steel walls that can stop that attack.
If you know the enemy will only send M1 Abrams, you simply set up trenches (below-grade dug structures). Tanks are direct-fire, and the ground is a surprisingly good shield. The M1 can probably penetrate any reasonably built bunker with ease: thanks to heavy 100mm+ sabot rounds (I forget how big tank guns are but... much bigger than M2 guns)
If you build a trench + bunker, now the opponent has to send the M1 Abrams (for the bunker) + the M2 Bradley (for the trench). Now you have an opportunity for the bunker to shoot the Bradley with a 100mm weapon, killing it. And for the trench to similarly attack the tank, largely with impunity (if the supporting M2 is dealt with).
Or maybe the US Army decides to call in the AC-130 and just pew-pew-pew you from the sky at that point.
Ah, the joy of the Military Industrial Complex's feature treadmill.
HEAT rounds and Sabot rounds just aren't useful against civilians or soft targets. They're a weapon for dislodging highly armored enemies: like bunkers, tanks and the like.
------
The weapons that are useful against soft targets are pistols, machine guns, rifles, and the like. And they're already being used in crimes and other such situations.
There's no point shooting 120mm tank sabot rounds at people, because a 9mm pistol will effectively kill at much cheaper prices. There's pretty much nothing to fear from the more sophisticated weapons. A singular 120mm tank round weighs nearly 40 lbs.
In contrast, you can carry something like 1000+ rounds of 9mm ammunition in the same 40lbs weight. The weapons used on the battlefield (ex: missiles, HEAT rounds, rockets, etc. etc.) simply aren't useful in soft / civilian settings.
1. Very slow rate of fire -- It takes time to load the weapon.
2. Low number of shells -- an M1 Abrams only can carry 40ish shots.
3. Extreme heavy weight / armor is redundant -- 70-tons means really big engines, really big engines uses a lot of fuel.
-------------
I'd say the "heavy vehicle" that is actually designed for infantry are the M2 Bradley IFV. Less than 30 tons, a smaller 25mm chain gun with 900-rounds, armor still too thick for small-arms fire (but not redundantly / absurdly thick like the M1 Abrams).
The 25mm cannon is still capable of firing those "anti-trench burst rounds" that started this thread, and a faster rate of fire would be more useful than a bigger, slower 120mm boom.
Things like the M1 Abrams exist to kill things like the M2 Bradley. Sure, the M1 Abrams has some tricks (mainly the 50-cal secondary gun) to deal with infantry, but a lot of its features are straight up redundant if there's no enemy armor around.
-------------
A lot of military weapons, maybe most of them, exist to beat the strategies that beat lower level tactics. Ex: F22 is designed to kill airplanes, but cannot serve as a close-air support fighter very well.
A civilian might have to worry about a Predator Drone (seemingly the main weapon we use to kill targets from the sky). But civilians don't have to worry about F22.
Trenches (at least on the less mobile German side) were underground bunkers, concrete and steel reinforced that could survive literally hundreds of tons of high explosives. The shit fired here would be laughed at by WWI defences. Honestly the dummies in the trenches were getting hit yes, but they were still standing. 1916 those dummies would be five hundred feet in the air along with a ton of earth. And the machine gunners would be underground safe (if not actually sound).
Yes, the air burst attack there would kill anyone standing in an open trench.
But a minute after opening up (and remember this is going to be divisional level artillery you are airbursting here - hundreds of tanks across miles of front, someone will notice) once the attack starts everyone is under the ground in bunkers.
The minute you stop they come back out and start firing back.
(And they will have mined the ground, have anti-tank weapons etc.)
Honestly the more I think about how lethal a battlefield is nowadays the more I think any "front" less than 500 miles wide is just going to bog down