If one thinks about the challenge of trench warfare, it resided in the inability to cross "no man's land." Both sides had an equal propensity to stop the other one because each time the area was crossed, machine gun fire was waiting. The invention of the tank solved this problem. Being made of armor and material where bullets from machine guns simply "plinked" off its side allowed for troops to cross "no man's land" and overrun the trenches. At the same time, it also allowed for soldiers to follow it behind, helping to overrun the enemy, subsuming no man's land. Finally, the tank's shells could be aimed at trench areas, causing them to be servely undermined.
Tanks were often referred to by the troops as "land ships" because some of the models used on the Allied side were so large and cumbersome. Since they were the early models of that weapon, they didn't work very well, had mechanical problems, were slow and a lot of times the men inside would get sick from the engine fumes. Conservative commanders also didn't know how to use them very well and often just employed them a few here and there to support infantry attacks, instead of in numbers that might have made a difference.
As a Corporal in World War I, Adolf Hitler witnessed the futility of massed infantry attacks in the face of modern weapons. Hundreds of men from his units were slaughtered and he was wounded. The invention of the tank at this time, and the limited success with which it was used, made an impression on him, and he would remember this later when he was in power, and chose to emphasize the tank in his new army.
The weapon that was invented for this purpose was the tank. It was designed to be able to run over the barbed wire in front of the trenches and even over the trenches themselves.
The tanks did not really work as well as they should have because they were not really used correctly from a tactical point of view. They were not massed but rather used piecemeal.
Toward the end of the war there were a couple of instances of tanks actually being used properly and creating breaks in the German line.