Not even closely related roadrunners do this too, when talking with them (they're very sociable if they know you). It reminds me of the way cats twitch their tails when thinking up something imminently playful.
I came to the conclusion a cats tail behavior is an evolved anti-predation behavior. We think of this as "I can see the gears in my cats head turning based on its tail behavior". The wider a cats "field of attention" the slower the tail moves, ie: sitting calmly taking in the entire room so the chance for predators to approach undetected is low and hence the tail is nearly idle. The narrower the cats attention the more the more tail moves. Cat is focused on navigating obstacles to get to a coveted perch in the room, tail wags at a medium pace as only half of the room is under observation as it charts a path across furniture to the goal. Cat is stalking another animal with intent focus on attacking, the tail is in its most agitated state and hence will draw out undetected predators to the tail rather than the rest of the cat.
I realized this after watching a kitten that was unable to resist attacking our other cats tails when the older cats were focused on something. Wagging of the tail draws out any other predators that may be stalking the cat itself when its attention becomes highly focused, such as when hunting prey.
I had one come within a couple of feet of me at an open area at a zoo. Apparently I was interesting and he came over to check me out, cocking his head back and forth to get a good look. My family was quite jealous.
Apparently, squirrels flick their tails to distract predators from their body. They are saying "I see you predator! If you attack me, go for my fluffy tail that has no critical organs in it!"
Squirrels flash their tails for a lot or reasons, including trying to attract mates, as well as distract predators, but they also use their tails to communicate with each other. Tree squirrels typically can communicate with each other via a kind of semaphore sent by flashing their tails and most of their tail flashing is squirrels silently communicating with each other.