Dogs wag their tails as a way to communicate their emotions and social signals to other dogs and humans. A wagging tail can indicate happiness, excitement, friendliness, or even nervousness in dogs. It is an important form of non-verbal communication for them.