As for docking this is amputating the tail of a dog which in fact is removing an important body part used for balance, maneuvering, and communication.
Funny how my two corgis with their docked tails have no trouble with balance, maneuvering and communicating. In fact, they do better at those three things than my malinois who do have tails.
Rottweilers and often other herding breeds were often kept/stables with the livestock they worked. They had tails removed to prevent them from picking up a big hard ball of fecal matter on the end, which would bang on the hocks and cause infected sores. Removing the tail eliminated this.
Yea, see, I have trouble here. There are herding breeds and LSG breeds who do have tails and do just fine.
I've heard people say that the pemmies tail was docked to prevent injury, and as a pemmie owner, that just doesn't make sense to me. The natural pemmie tail is spitz-like. It's carried over the back. It's thick and has a nice coat of fur to protect it. It's not so likely to drag on the ground, get caught in things, get stepped on, etc. And the cardi never had to have his tail docked, yet both breeds originated as cattle drivers in Wales.
The other reason I have read many times is that dogs with tails were taxed. Working and herding dogs were docked because they were tax-exempt.