The quick answer to your question is “sorta”. Since I’m being so exact saying that, I’ll go into a little more detail.
The common “cannonball” of the American Civil War is very similar to cannonballs from many years before. Its a cast iron (most of the time) solid ball. Being cast iron and fired at a high (relatively, anyway) velocity, if it hit a hard enough object it might break apart and throw little chunks of itself everywhere. In most cases the ground would not quality as a hard enough object.
How common this breakup might be is hard to say, but you should keep the following in mind:
-
Cast iron roundshot (the more “accurate” term) was made to be used once. If then enemy could use it back against you (which would almost be a miracle in itself given the diversity of calibers in use at the time), it would be a bad thing.
-
Roundshot was not fired from a rifled barrel in just about all cases, so accuracy was really a primary design element in these weapons.
-
Roundshot was made under a huge variety of conditions, ranging from iron foundries, to almost homemade cottage-work conditions. It was not unheard of for roundshot to fly apart upon leaving the barrel because the cannonball itself was cast in such a flawed way.
-
With #3 in mind though, most cannonballs could be fired at rolled iron plate thick enough to stop them cold without breaking up, so its hard to judge the overall behavior.
When used in an anti-personnel role, the standard technique was to fire at the ground in front of the advancing troops, and just let the cannonball roll along the ground. With massed troop formations marching in tightly ordered lines, this is rather like a lethal form of bowling. The cannonball would hit the ground, skip along a little above the ground, hit again, skip again, etc. Anybody who doesn’t think this would be unpleasant to be on the receiving end of probably doesn’t have the sense to flinch from foul balls hit into the stands either.
Now that we’ve covered cannonballs and the material properties of cast iron in more detail than more people ever care about (and resisting the urge to continue anyway), I’ll get on to the rest of your question. Could these “cannonballs” explode?
The manufacturers of weapons tried for a long time to get the explosion to occur at the point of impact. Hitting a man you want dead with a 20-pound ball of iron going 350mph might be sufficient, but rubble-filled stone walls would likely be less impressed. However, if you could make the wall explode from within, NOW you’re talking death on a large scale, which is what they were really after.
Making a metal object filled with gunpowder explode was no big thing back then. The quality of cannon making generally proved that was readily possible. Unfortunately, that was too close for comfort, and rather defeated the purpose.
Some experiments (by which I mean somebody sold an unproven idea as the way to hurl death afar, but which generally had lethal consequences for those nearby) were done with firing a hollow iron ball filled with gunpowder with a fuse sticking out the back so that the charge in the gun would also light the fuse. Since this hollow ball was essentially a shell to move the gunpowder away from you until it exploded, it began to be referred to as a "shell. (Who says that artillerists aren’t creative?) Unfortunately it was far too common in this arrangement for the fuse to get pushed back into the gunpowder-filled hollow, sometimes making the shell explode before it had even left the gun. This was generally bad for the gun, and somewhat worse for the crew or anybody else who happened to be standing nearby.
Finally some enterprising person figured out that if the fuse faced away from the firing charge in the gun, that the heat of the gasses that leaked around the shell would ignite the fuse anyway. This made everybody happy, except those downrange of the cannon.
While very destructive, for a long time these explosive shells were mostly limited to being used in short-barreled, high angle mortars. The reason being you had to make sure that the fuse stayed facing to the front of the gun, so you couldn’t just pop it into the barrel and let it roll down. The shells had to be carefully lowered down into the barrel, thus the limit of short barrels that were already almost vertical. If you weren’t careful the shell could lodge in the barrel, causing the gun AND the shell to explode. This is a way to really ruin your own day.
In case you’re wondering why all this effort to keep the artillerist alive, keep in mind that in this era an artillerist was rather like a good software developer is today. If you didn’t treat him right, he could get another job elsewhere, and the results might be hazardous to your health. Plus, they cost a fortune and took a long time to train. Additionally, there is a morale benefit to not having your own men explode at random in battle. That kind of thing can shake your confidence.
Anyway, this basic type of mortar was still in use (and essentially unchanged) at the time of the American Civil War, and once the shell was flying, nobody much cared if you called it a cannonball or a shell. Either way you didn’t want to be nearby when it hit. However, this was more of a strategic weapon then a tactical one, since large mortars didn’t deal with moving targets or changing battlefield conditions well.
There were also shrapnel shells in use at the time. These were designed to fly some distance and then burst over the head of enemy troops, spraying them with small pieces of solid shot. These were generally fired from rifled barrels, so they actually had some accuracy, but you almost had to guess how long you wanted the fuse to delay before bursting. Many of them burst too high or too low to be effective. These could be fired from light guns, and so would almost certainly be in use in a tactical role in any significant battle where they were available.
Some larger guns also fired explosive shells from rifled barrels, but these were normally so large and heavy as to be fortress or naval only weapons. They were also extremely destructive to infantry in the open, so most people who got to see them explode from “nearby” did so to their own detriment.
So, to sum up, “Sorta…” 