Rejection is hard, and it takes a bunch of "victory thrills" to overcome one defeat, at least for me. We know all the platitudes: that success is getting up one more time than you're knocked down, that only the strong survive, that the great men and women of the world often felt the sting of defeat, too. None of that helps when you've just gotten that "Dear Author" letter.
You start trying to prepare yourself for it. A queried agent asks for a partial: "Don't get your hopes up." A publisher notifies that your MS has been sent up to the next level: "It's just one tiny step." Your book snags a favorable review: "That doesn't necessarily translate to sales." And even when everything in your career is working, other considerations throw defeat in your face. "Yes, you've sold a book, but the rest of your life? What a mess!"
We know that accumulated defeats begin to affect a writer's work. In his later years Mark Twain became more and more bitter about life. His writing success was countered by personal losses, and his observations about mankind became more and more sardonic and critical. It's painful to compare those final barbs to the gentle humor of his early works. Many of Shakespeare's later plays are dark as well, often portraying the inhumanity of man in scenes that are shocking when compared to the more tolerant early works.
The good news is that life's defeats add power and truth to our writing. All those "Dear Author: No" messages make us examine our weaknesses, and life's other buffets provide understanding of the fact that good can't exist without evil. Without bad times, how will we know happiness when it arrives? And how sweet is even a moment of laughter in the pall of humdrum and the pain of sadness?
I suppose, therefore, that the thrill of victory does balance the agony of defeat. Eventually, if you live long enough.