Dogs are descendants of wolves, which are pack animals. In a pack, members stick together for safety, companionship, and hunting. Your dog sees you as their pack leader, and staying close to you is instinctual.
Dogs form strong attachments to their owners. Following you is a way for them to strengthen their bond and feel close to you.
Dogs feel safe when they are near their owners. Your presence provides them with a sense of security and reassurance.
Dogs love attention and affection from their owners. Following you allows them to be near you and receive the interaction and love they crave.
Dogs are naturally curious creatures. They want to know what you're doing and be a part of it. They may follow you to see what interesting things you're up to.
Some dogs have a protective instinct and feel responsible for your safety. By following you, they are keeping an eye out for any potential threats.
Dogs are energetic animals, and they enjoy being active. Following you may be their way of hoping for a game of fetch or a walk, as they associate you with fun activities.
If you've established a routine where your dog is often with you, they may simply be following what they consider normal behavior.