Many dogs were actually bred to kill rodents. that is why rat terriers are called that, is because they are such great rodent killers. Just like a herding dog will have the herding instinct even when they have never seen a sheep, a terrier will usually have that instinct to go after a rodent.
Several dog breeds that were also bred to hunt rodents are West Highland White Terrier, Scottish Terrier, and the Dachshund; but there aree also other breeds that will go after rodents. Miniature Schnauzers are also very fast and can be amazing at catching mice and rats.
Westies were bred to have a very thick tail because they are trained to go don into gopher holes after gophers and ground hogs. Sometimes, they would get stuck in the hole, and the owner would have to pull the Westie out by his tail.
So, the thicker the tail, the easier it was to pull the dog back out of the hole.