Ta-ta has been around as a nursery-word for �goodbye' since the early 1800s. Dickens was one of the first to use it in print in The Pickwick Papers in the form 'tar-tar'. Variations have included ta-ra - as mentioned in your question - tatty-bye, TTFN (ta-ta for now) and so on.
Like many nursery-words, there doesn't appear to be any specific reason why the word took the form it did...it might as well have been 'boo-boo', 'ra-ra' or virtually anything else along these lines!