From the Super Mario Wiki
Spiked Balls are objects found in New Super Mario Bros., New Super Mario Bros. Wii, New Super Mario Bros. 2 and New Super Mario Bros. U. They usually appear in castle levels acting as obstacles, rolling around and smashing anything in their way. Ball 'n' Chains are Spiked Balls with chains attached to a pivot swinging in circles. In Super Mario Bros. 3, New Super Mario Bros. Wii, and New Super Mario Bros. U, Spikes produce Spiked Balls and throw them at players. A sub-species of Spike called Stone Spikes produce and drop Spiked Balls made of stone at players.
A Giant Spiked Ball is a larger version of the Spiked Ball also found in New Super Mario Bros. They, like their smaller counterparts, are almost indestructible, except to Mega Mario or Mega Luigi. They are usually found in castles and can also destroy anything it rolls over, including the smaller Spiked Balls. In New Super Mario Bros. Wii Giant Spiked balls are found only in the World 8 where they appear in World 8-2, and World 8-Airship where Bowser Jr. uses them as exploding weapons against Mario. However, Mario can use them against him by Ground Pounding the ground to throw them into the Koopa Clown Car 3 times. In New Super Mario Bros. 2, both Spiked Balls and Giant Spiked Balls reappear. A Pair of Very Large Spiked Balls appear in the World Mushroom Castle. Icy Spiked Balls appear in World 4-1. One can be found in World Mushroom-A which helps Mario obtain a Star Coin. Spiked Balls also feature in the battle against Morton Koopa Jr., where Morton fires them from his wand to attack Mario/Luigi. In New Super Mario Bros. U, they are replaced by Grrrols. However, there is a giant variation called Ball 'n' Chain which is a giant Spiked Ball on a string with spikes.
Both Spiked Balls and Giant Spiked Balls (under the name Spikey Balls) return in Super Mario 3D Land. They function very similarly to the preceding games. They can be destroyed by Statue Mario and invincibility.
Spiked Balls also appear in several minigames in Mario Party 9. In the minigame Bumper Bubbles, players must try to collect balloons while avoiding Spiked Balls that fall onto the screen from above; hitting a Spiked Ball results in a player's bubble popping, which causes all their balloons to be released and for them to fall off-screen. They also appear in the minigame Tumble Temple, in which the players must avoid the Spiked Balls and Giant Spiked Balls that roll through several pegs from above; hitting one results in that player being eliminated. Additionally, in Chain Event, players must slide down chains, flipping from one side to the other to avoid Spiked Balls. The minigame Spike-n-Span also involves one player hitting the platform above to roll a Spiked Ball in the direction of the other players.