The dog keeps hiding under the bed when they are under stress or looking for safe space and protective space. They may also hide under when they are physically ill or might be sick. When they want a cool, dark space where they can sleep comfortably where there is no external threat or worries from the environment they will sleep under the bed to sleep peacefully. Canines are den animal they love small enclosed space it makes them feel safe and help them to relax. It also reduces their stress, and anxiety too!