That Mozart is the greatest musical talent the world has ever seen, is quite undisputable. I just cannot imagine how it is possible for him to play a magnificent sonata, such as the one in C (K. 309) "all of a sudden.... out of his head" (his words)... What lies behind such a mind-blowing explosion of talent?...
Here is the history of Sonata in C (K.309), as copied from Einstein's book on Mozart:
Sonata in C and the one in D (K. 311), "must be called Mannheim sonatas, since both were either written out or completed in Mannheim. We are particularly well informed about the circumstances attending the composition of the first one. Mozart had improvised it in his last concert in Augsburg, on 22 October ; or to be more accurate, he had improvised the first and last movements, with a different slow movement. 'I then played ... all of a sudden a magnificent sonata in C major, out of my head, with a rondo at the end - full of din and sound', he wrote in a letter of 24 October 1777. The characterization applies to both the first and last movements, particularly the passages in the rondo that have thirty-second note tremoli; but Mozart forgot to mention the subtlety with which he had brought this movement, 'full of din and sound', to a pianissimo ending. Both movements are full of pianistic brilliance, the first being like a transcription of a C major Salzburg symphony for a Stein piano. But the middle movement, an Andante un poco adagio, was not simply written down from memory in Mannheim, but rather freshly composed, for in it Mozart sought to paint the character of Mlle Cannabich, daughter of his new friend, the Kapellmeister Cannabich. [...] The movement is a 'tender' and 'sensitive' andante, containing ever more richly ornamented repetitions of the theme".
Here is the Sonata in C, K 309, performed by Zoltan Kocsis.