Let's take a look at a good illustration of the explosive force of an artillery shell: the crater it forms. When the shell's detonator is configured to explode after the shell impacts the ground, instead of in the air, it can make a pretty impressive hole.
Figure 88: craters formed by HE shells of various calibers.
The HE effect of a 76 mm gun was considered enough for infantry support (T-28 and Matilda CS had 76 mm guns, for example), but as you can see the hole it makes is quite small. A hole from a 122 mm HE shell is large enough to use as a trench. A hole from a 152 mm HE shell is large enough to stand in. A tank that comes across such a crater would have a difficult time crossing it.
Shrapnel effects of 152 mm, 122 mm, 107 mm, and 76 mm HE shells. Shot direction is from left to right.
As you can see, the shrapnel flies out to the side more than it does to the front or the back of the shell. Increasing the caliber increases the width, but not the length, of the rectangle. A 122 mm HE shell fired from an M-30 howitzer hits only 5 meters further than a shell fired from a ZiS-3 76 mm gun, but at twice the width.
A data sheet on various 45 mm shells gives a 10 meter radius for its high explosive fragmentation shell (strange, given that this is usually a rectangle). It is listed as producing 150 fragments. Another data sheet on experimental guns lists the data for the 95 mm gun (450 fragments), 100 mm AA gun (300 fragments), 107 mm mountain howitzer (450 fragments, 3 meters cubed crater) and the 107 mm corps gun (800 fragments, 3 meters cubed crater).
If you're shooting at a tank with an AP shell, you have to be very precise. Realistically, shots are limited to several hundred meters with WWII era sights, maybe a kilometer or two if you are in a defensive position and have measured out the distances to various landmarks. Various objects blocking your path can limit that distance even further. Indirect fire artillery has no such problems, since it can fire over the objects, and cover hundreds of square meters with their shrapnel, instead of just one point.
Accuracy for a 76 mm model 1942 gun (ZiS-3) at full charge and 122 model 1938 howitzer (M-30) using the first charge.
As you can see, at a range of several kilometers, the dispersion is quite high. A long barreled gun, like a ZiS-3, has a high shell velocity. It is more accurate than a short barrel howitzer (8 meters of width-wise dispersion at 3 km, compared to 12 meters for the M-30), but its flat trajectory results in more length-wise dispersion (192 meters at 3 km for the ZiS-3, compared to only 152 for the M-30). The flat trajectory is important for an anti-tank gun, however. If you are shooting at a target at a distance that is close enough, the trajectory of the shell will not surpass the height of the target, and you will hit even if you estimated the distance incorrectly. The higher the shell velocity, the flatter the trajectory, the further away the target can be while you are still capable of taking advantage of that effect. A shell travelling with a higher velocity is also carrying more kinetic energy, and is thus more capable of penetrating enemy armour.
The curved trajectory of the artillery shell was used by SPG crews in combat. Nikolai Konstantinovich Shishkin, an ISU-152 commander, recalls one such instance: "One battle was memorable. Three tanks of the advance guard left the forest and went up on a hill, where they were shot by a Tiger. There was no way to go around that clearing, and the brigade commander told me: "You are a beast-killer? Go destroy that tank." My SPG moved forward, arrived at the base of the hill, and slowly climbed up it. I climbed out of the hatch and stood up. I saw a German tank, its rear pushing against a large tree. The Tiger shot. The wind from the shot nearly dragged me out of the hatch. While I thought what to do, he sent one or two more shells my way, but missed. Only a section of the casemate was sticking out, his trajectory was flat, he could not hit me. What do I do? If I go forward, I will die. I noticed a bush on the hill. Looking through the gun barrel, I instructed the driver to move the tank so the bush lined up with the tree the enemy tank was under. I replaced the gunner. The bush is in my sights. I move the gun barrel to where the enemy's tank should be. There are a million calculations, but I spent less time making them than I spent telling you about it. Fire! I climb out, the Tiger's turret is lying next to it. Direct hit!"