Because you asked:
The iron antipersonnel balls inside your Confederate Sideloader Case-Shot shell were "cemented" in place by a matrix consisting of asphalt or pinesap. An external impact powerful enough to break that type of shell into pieces would knock the balls loose from the shell's iron body. Therefore, the odds most highly favor your 12-pounder caliber Sideloader Case-Shot shell having been broken into two (or perhaps three) unusually large pieces by water getting into it and freezing... like sometimes happened to glass milkbottles (full of milk) left on the houseporch in deep wintertime by the Milk Deliveryman when I was a young child (1950s).
That being said... there is one other possibility, though it occurs VERY rarely. A fired explosive cannonshell would sometimes burrow deeply into the ground before its fuze detonated the shell. (Relic-diggers call that a "groundburst" shell.) In that situation, the side of the shell which was pressing against the very-hard subsoil tended not to break into small pieces, while the side which was facing the softer topsoil blew to bits. On a couple of occasions I myself have dug one of those underground-exploded shells, and the deepest fragment of it had some of the antipersonnel balls still stuck onto the frag.
By the way... now that you've confirmed that your cannonball fragment's antipersonnel balls are iron, which means it is part of a Confederate "Sideloader" Case-Shot shell, I can tell you with certainty that the approximately .9"-diameter hole on the edge of your frag is the "sideloader" hole (for loading the antipersonnel balls into the shell when it was being manufactured).
Here's a photo showing what that shell looked like when it was intact... and another photo showing one which has been professionally sawed in half. The halfsection shows the shell's copper fuzeplug, the lead sideloading plug, and the iron antipersonnel balls helf in pinesap matrix. The one-inch-wide dark-grey area below the fuze down the bottom of the shell is its gunpowder bursting-charge.
Almost forgot to mention... the bullet is one of the many varieties of civil war .58-caliber "Minie-ball" which had three body-grooves. Those were manufactured by both sides in the war. To be able to tell you whether yours is yankee-made or Confederate-made, I need to see photos of your Mine-ball's top and the cavity in its base.