The forces didn't go around the trenches, not only because the trenches pretty much extended across the entire front, but also because neither army had the ability to move large numbers of troops quickly. Most troop movements near the front were on foot, at about 2mph, or slower if attacking or moving across ground churned up by artillery.
Even if the attacker could break through the enemy's trenches or find a weak spot and overrun it, that slow moving attacking army ran into even more of:
The machine gun, and rapid fire breechloading artillery. While both exist before WW1, it was was the first major war where both were employed in large numbers. Those two weapons allowed an army to throw a great deal of artillery shells and bullets at an attacking force that didn't have cover. This high firepower now made defense in depth practical - One or two machine gun positions set up a mile behind the trenches can hold off a very large number of attackers moving on foot across open ground, at a very low cost in manpower to the defenders.
Communications were also very slow, by modern standards. No field radios, and field telephone tech of that day couldn't be rapidly extended, so an attacking force couldn't call down artillery upon the machine gun nests they ran into, once past the trenches. Front line communications were by runner, or on occasion homing pigeons were also used.
The result was stalemate. Too much firepower for a slow moving army to maneuver around the hot spots, or establish a breakout if a trench were overrun. The only real counter to the very high firepower in WW1 was to dig in and get below ground, to limit casualties, and to provide such an obstacle to prevent the other side from attacking.
Even with the offensives that did overrun a substantial amount of trenches, such as the battle of Cambrai, the attackers didn't get very far. The British got about six miles into German held territory, before the Germans regrouped and began bringing down massive artillery on the British forces now out in the open, plus rapidly deployed machine gun positions. That stopped the British army and created a huge number of casualties, so the Germans counterattacked successfully, only to run into the same problem - their forces, now out in the open, were also vulnerable to high firepower defense. The closer the Germans got to the original lines, the more they ran into prepared positions (some made by them). The end result was a minor gain by the British, at a cost of about 90,000 casualties on both sides.
Put simply, the British army couldn't move fast enough to get past not only the trenches, but the secondary defenses behind the trenches, while exposing their troops in the open to artillery fire. WW1 brought unprecedented levels of firepower to the battlefield, before armies had developed tactics to deal with that firepower.
The eventual counter was to move faster than the enemy could react... mobile warfare.
By the outset of WW2, military tech had improved to the point where mobile warfare could be implemented. The German forces simply went around the Maginot line through the Ardennes forest in Belgium and cut off the defenders from supplies and reinforcements.
The key here, as opposed to WW1, was the much higher speed with which the mechanized German forces could move: 20mph versus 1mph, plus being able to communicate with field radios to deal with resistance, either by going around or by calling in their mobile artillery: the Stuka dive bomber.
But, that wasn't an option in WW1. The armies simply couldn't move a large number of troops that quickly or adjust their actions to meet a changing situation with rapid communications, to counter the immense firepower the opposition could bring to bear on them.