This supposedly illustrates the contrast between "true" genius and try-hard mediocrity. The music simply "comes" to Mozart, while suck-ass Salieri over here has to work at it like some non-divinely-inspired hack. In reality, while there are historical accounts of Mozart writing several pieces in short time spans, he was still an extremely diligent worker who went through numerous drafts. In other words, he turned out bullshit that he knew wasn't good enough, so he kept messing with it. That is what creating something great actually looks like, even for an undisputed genius.
For whatever reason, our culture in general hates that idea. You've probably heard some variation of the story that Sylvester Stallone penned the Rocky screenplay in one night after seeing Muhammad Ali fight. Well, it technically took three nights, but even then, it was a 90-page early version of the script, of which only about a third even made it into the film. It went through a totally normal revision process and a bunch of drafts, including one in which Rocky heroically throws the fight at the end.
So often, it's artists themselves who insist on putting this nonsense out there. Jack Kerouac intentionally cultivated a myth that he wrote On The Road in three weeks. In reality, he typed up the final version in three weeks after reworking whole journals' worth of material and at least six earlier drafts over the course of a full decade. But he wanted us to believe he banged out a free-flowing stream-of-consciousness masterpiece in an upper-fueled burst of inspiration that magically transcended conscious thought.
This sucks because in every case it implies that the creator did something that none of us lesser-thans possibly could, as if creation is some act of divine magic instead of a person just sitting down and grinding through it. Which is weird, because if you were buying a house and the builder was like, "Oh yeah, I got high and slapped that together over the weekend" you'd immediately be concerned.