Earlier quoted context omitted.
Yet there's plenty of animals that have tails and don't spend time in trees, such as dogs, horses and cows.
The tail seems like vestigial anatomy (originally useful in fish) that has three possible states in mammals: 1. Repurposed for a new function (tree swinging, signals) 2. Not much used but still in the repo (mice) 3. Garbage collected (apes).
Balance and navigation (birds, cats, etc) is still somewhat related to the original function in fish.
Sexual attraction/signalling
Grabbing stuff
A third leg in kangaroos
Fly swatter (cows and other large grazers)
For kids to hold onto their parent (elephants)
I'm sure there's a lot of other creative applications of tails that I'm missing.