You are ignoring the very real differences between gun types and their ordnance.
Gun Types:
Direct fire:
These weapons fire along line of sight at high speed and at very low elevations. They include muskets, rifles, cannons, and - in a later era - anti-tank weapons. Much of the damage is done by the velocity of the projectile, whether a solid shot such as a cannon ball or bullet or an exploding one like an anti-tank ordnance. In order to obtain the high muzzle velocity a high ratio of charge weight to projectile weight is required - consequently also improving accuracy especially once rifled barrels became common place. The projectile approaches it's target at a nearly horizontal elevation
Indirect Fire - Howitzers:
These indirect fire weapons fire at elevations of from roughly 15 degrees to 45 degrees. The increased angle of fire allows for a much lower ratio of charge weight to projectile weight, allowing for heavier projectiles - ideal for high explosive ordnance where the bigger the bang the better. Accuracy is less than for an direct fire weapon, so effectiveness is only obtained for larger targets.
Indirect Fire - Mortars:
These indirect fire weapons fore at elevations of from 45 degrees to 85 degrees. Some damage is done by vertical penetration of the projectile in addition to its explosive charge. Accuracy is reduced again relative to howitzers due to the longer flight time.
Note that the key difference between the use of howitzers and mortars is that howitzers increase range by increasing elevation (towards 45 degrees) while mortars increase range by reducing elevation (towards 45 degrees.
An effective anti-tank weapon (and its ordnance) must have the following characteristics:
High muzzle velocity to penetrate the armour (up to a foot thick on the front of heavy tanks) and allow acquiring fast moving targets;
Explode after initial target contact; and
Direct fire so as to be aimed at a smallish target.
An effective anti-personnel weapon and its ordnance must in contrast have these characteristics:
Medium muzzle velocity as formed units (and trenches) are fairly large and stationary or slow moving;
Explode on - or ideally shortly before - target contact; and
Indirect fire for effectiveness against targets behind terrain.
An effective siege gun
Muzzle velocity irrelevant as fired only at stationary targets such as buildings;
Explode on - or after as in a bunker buster - contact; and
Indirect fire for effectiveness against targets behind terrain.
Weapons commonly used in WW1 were designed for use against structures and personnel, so of the latter two types. When tanks appeared they could get by with quite light armour because no direct fire anti-tank weapons existed on the battlefield.
The rifles (calibre too small to penetrate armour), howitzers and siege guns
(both too inaccurate and with too slow a projectile for targeting tanks effectively) of World War One were designed for a very different purpose than weapons designed to target and destroy small, fast-moving, armoured targets such as tanks. Other than lucky hits on the tread, there was little most WW1 units could do against tanks until specialized anti-tank weapons had been developed and distributed.