Dogs may choose to sleep under the bed because it is more comfortable and safe. Under the bed, it's usually dark, quiet, and at a moderate temperature, all of which help your dog relax and fall into a deep sleep. Your dog may feel that under the bed is a safe place. In the wild, dogs will choose to sleep in caves because they provide protection and concealment. The space under the bed has similar features and can provide your dog with a sense of security.
Dogs have a very sensitive sense of smell. They may choose to sleep under the bed because there are some special smells there, such as Your dog’s own scent or your family’s scent. These scents can help dogs relax and fall into a deep sleep. In general, dogs may choose to sleep under the bed because it is more comfortable, safe, has a special smell, etc. If you don't want your dog to sleep under the bed, try providing him with a comfortable, safe bed or training him to sleep somewhere else.