Rainbow sharks hide because hiding is how they claim their territories. These territorial fish love to stake their claims on caves, tunnels, and other hiding spots by resting there.
Additionally, newly-introduced rainbow sharks may also hide because they haven’t adjusted to their new environment. They’ll eventually come out when they feel safer and more comfortable in the tank. For rainbow sharks, hiding is perfectly normal behavior and usually isn’t a cause for concern.
Very rarely, rainbow sharks may also hide and become inactive due to water issues or illness. If you notice your rainbow sharks are abnormally fatigued, less active than usual, or refusing to eat, be sure to check the water quality and see if there are any visible signs of an illness on their bodies.