I believe all writing has a bit of the author in it, it's impossible to fully dissociate ourselves from our work when even the particular word or colors we use to represent something could tie into past experiences.
To draw from past experiences is not only a nescessity but inevitable as well, and a lot of artist inevitably reveal something about themselves in their work, wether they like it or not.
That being said, art can come from many places... A desire to experience something akin to the characters is for sure the most common, and it's what our entire fantasy escapism draws from.
But a desire to avoid it could also factor in... Like, nobody really wants a relative they care about to pass away, yet that appears a lot in fiction.
And sometimes a creator just has to pull from purely fictional emotions to create a true feeling, like... Nobody has ever felt magic run through their fingers, or the texture of the scales of a dragon.
At the end of it all, human emotion is the core of all art, i don't think people want nescessarily to experience what any one character goes through, but watching them react to it kindles the bond we created on them on a human level... Even the sad moments can create a resonance.
Not to mention there is the cathartic element to it, seeing characters overcome things we ourselves fear, dread or might even be going through in our personal lives can be freeing... Like you just found the piece of the puzzle you were missing to stop letting those insecurities hold you back.
TLDR: Art is cool