Dogs stare for a number of reasons, but mainly to communicate. They stare to observe and act on cues. One such example is as an owner picking up a leash. The dog then learns that the owner picking up the leash means it would get some time outdoors for a walk or a run. Sometimes, staring is a way to look for opportunities to get rewarded with a treat by following commands.
Staring also serves as a method of seeking attention or telling us what it desires, maybe a tasty snack we’re holding or to start an activity the dog has taken a liking to.
Not all stares are friendly interactions. Some dogs may engage in staring with aggressive body language. To stare in a challenge like that would be rude and threatening. In such situations, it would be ideal to slowly back away and not make eye contact.