I think it's an evolutionary pattern of behavior derived from hunting in the jungles. Jiggling the tail serves two purposes, it gives the predator (cat or lion) a chance for a better footing which might make the leap higher and more precise, and it causes some noise which makes the prey raise its head and stand still, allowing the cat to better position herself for the strike.
Of course this is speculation...
I think it's one of the cutest behaviors...