Is "thousands of thousands" grammatically correct? Why does it seem that "thousands upon thousands" sounds better, even though the former is closer to the logical truth? Is there any difference at all?
I realize this is an English language question site, but to answer this question in terms of math:
"Thousands of thousands" = 1000 x 1000 (or more) "Thousands upon thousands" = A x 1000 (where A is any relatively small number)
So in simple terms, "thousands of thousands" is a lot more than "thousands upon thousands", although I do agree with you the latter does sound better.
To my ear, thousands upon thousands could just mean "several thousands" or "many thousands".
I've never understood it to mean thousands of thousands, which would amount to millions — which the speaker would probably use, if that was meant.
To my ears, thousands of thousands is a really large number (possibly a million) at a specific moment (as already indicated in other answers)
However, thousands upon thousands might imply a progress in time: a thousand followed by another thousand later followed by yet another thousand even later and so on.
It seems to me that 'thousands upon thousands' gives the impression of an innumerable number and then just to make it profoundly clear that it is a number beyond a 'name' ... Tack on a 'thousands of thousands' onto that innumerable number!