A fish tank lets you see fish behavior close-up. Fish will dig in rocks or other substrate to make a nest for spawning, or dig a burrow for hiding. Understanding why your fish are digging helps you learn more about how your fish act in the wild.
Some fish dig into rocks, or other substrate, to create spawning pits. These pits serve as a nest for the fish, where they can lay eggs. Many cichlids are known for this behavior, including the small ram cichlid, larger earth-eater cichlid and many African cichlids. Other families of fish, like sunfish, also practice this reproductive behavior. If you see your fish digging a pit like this, it can mean that they are preparing to spawn.
Fish may also dig for their food. Many species of catfish and carp will root through substrate looking for food. The "whiskers" or barbels on catfish and carp actually function as sense organs, helping them to detect food when they dig. These help fish "taste" food in the substrate when they are rooting around for it. Fish known for this behavior may do better with a softer substrate like sand instead of rocks, as rocks can damage their barbels.
Digging a Den
Some fish dig to create burrows or dens. The saltwater jawfish (Opistognathus spp.) will dig a burrow to create a home. They will usually incorporate coral debris or other rocky material in their dens to help keep the burrow from caving in. This means that their substrate should be mostly sand, with some rocky material. They also require a deep enough substrate bed for them to burrow. Some species may dig up to 9 inches into the substrate. Their digging can improve the health of the tank by moving the sand around, preventing "dead spaces" where harmful substances can build up.
Some fish dig to bury themselves in rock to hide. The weather loach, a nocturnal fish, will do this in the daytime. The fish tends to get active a night, and sleeps during the day. To protect himself from predators while he sleeps, the weather loach buries himself in the rocks to hide. This fish will learn to come out during feeding time, regardless of the time of day. However, they will still be most active at night.