From Nookipedia, the Animal Crossing wiki
Rocks are scenery items that have appeared in every Animal Crossing series game. There are usually five to ten rocks in a player's town, and the rocks can be a single rock or be in clumps of two. Depending on the season, banging a rock with a shovel or axe may result in a pill bug, centipede or house centipede appearing; this is the only way of finding them. In winter, there is snow on them, but the other seasons do not change anything in the rocks. Rocks cannot be picked up, moved, or changed in any way.
Once a day, one of the rocks in town hold Bells inside of it. To get the Bells, the player has to go around their town and hit random rocks with an axe or shovel. In about five seconds, the player must hit the rock as many times as possible.
In Animal Crossing, the rock will release up to 23,300 Bells as three sacks of 100, three sacks of 1,000, and two sacks of 10,000; in Animal Crossing: Wild World, the rock will release up to 8,500 Bells as sacks of 100, 200, 400, 800, 1,000, 2,000, 4,000; and in Animal Crossing: City Folk, the rock will spurt out up to 16,100 Bells as sacks of 100, 200, 300, 500, 1,000, 2,000, 4,000, and finally 8,000.
In Animal Crossing: New Leaf, the rock will release up to 16,100 Bells as sacks of 100, 200, 400, 800, 1,000, 2,000, 4,000, and 8,000.
In Animal Crossing: New Leaf, in addition to money rocks, players are able to destroy "fake" rocks to produce ores. These can be given to Cyrus at Re-Tail to dye items (mainly furniture) different colors.
If the player strikes a money rock with a Silver Shovel, it may produce ores instead of Bells.
In the Animal Crossing: New Leaf Welcome amiibo update, the ability for the player to sit on rocks was added.