He couldn't physically hear the performance of it, but it's possible he could "hear" what it would sound like - and he very possibly heard it in his head before writing a single note down on paper (or however he recorded his music).
I'm not sure everyone has this ability, but whenever I've written/recorded music, I almost literally hear it before I even try to create it or play it. My memory of sound is REALLY strong. I've never had someone go "oh yeah, me too!" when I discuss this though, so I have no idea if it's a common thing or what. It's like borderline hallucination, the clarity with which I can recall music and sound. I would wager that a lot of composers over the years have had this ability, especially since you couldn't exaclty spin up an orchestra in your livingroom while composing an operatic piece in 1800 :)