Tail motion and eye contact are parts of a complicated inborn system of communication among dogs.
The signals let dogs figure out who is top dog in a group or when meeting a stranger. They can also communicate emotional states.
Tail wagging may simply indicate excitement. Position is important, too.
The tail held high is a signal of dominance, which may be challenged or not, and a tucked tail shows a dog is kowtowing or accepts lower status.
The social signals can best be observed in wolves.
One of the things they do when they challenge each other is to monitor the autonomic signs, such as heart rate and blood pressure, that signal emotion.
Some of these signs are read indirectly, through changes in pupillary light.
If the pupil becomes wider, it generally means fear or at least ambivalence.
If wolves’ pupils narrow, on the other hand, based on other bodily postures and signs, it generally means they are angry, and you had better take them seriously.
Signals by domestic dogs are more ambiguous because owing to human intervention in their breeding, they are divorced from the original meanings and can signify anything from “come and play” to “watch out.”