There are few reasons why lizard hide under rocks and here are the reasons.
1. They Are Scared
Lizards find it safe to hide under a rock because there are predators lurking outside that can eat them. So hiding under the rock gives them a general feeling of safety.
2. To Regulate Temperature
Lizards are cold blooded reptiles and they need to cool their body when it is too hot. So, going under a rock cools their body and keeps the temperature balanced. This is a very important step because if they don't maintain their body temperature then they will die. They will die if the body temperature is too high or too low.
3. To Find Food
There can be insects hiding under those rocks and going there will give easy access to food. Insects also hides under the rock to protect themselves from the heat and when lizards goes there they get these insects.