Dogs wag their tails to communicate their emotions. The speed and direction of the wag can indicate different things.
A dog that is wagging its tail quickly and happily is usually feeling excited or happy.
A dog that is wagging its tail and jumping up and down is usually excited about something, such as seeing its owner or playing with a toy.
Dog that is wagging its tail slowly and low to the ground is usually feeling submissive. This could be because they are afraid or because they are trying to show respect.
A dog that is wagging its tail quickly and stiffly could be feeling aggressive. This could be a warning sign that the dog is about to bite.
Dogs may also wag their tails for other reasons, such as to keep their balance, to signal to other dogs, or to express boredom.
It's important to pay attention to the other body language of your dog, such as their facial expression and their posture, to get a better understanding of how they are feeling.