In terms of fiction and nonfiction writing, if you're serious about your craft and thinking about deciding to go professional, you'll eventually have to go to the process of submitting manuscripts to editors and publishers. If they accept it, well and good. You don't have to read the rest of this entry. If they reject it, it's not uncommon that I witness writers (myself included) taking it personally. My advice? Don't. Here's a secret: Publishers and editors don't reject writers. They reject manuscripts.
Now I think that's where most people make the mistake. They associate their work with themselves. And that's not necessarily the case, for the same reasons that a writer will write many different and varied works in their lifetime, or for the reason that a particular piece of work might outlive an author's lifetime and popularity (and sometimes even their intent). When an editor or publisher rejects your piece, they're rejecting your piece, not you. Chances are, they're still open to you submitting a different work to their publication or sometimes, a revision of your manuscript.
Honestly, that's all there is to it. Writers can change, grow, evolve, or simply write in different genres and different styles. A manuscript won't sprout arms and revise itself or update itself. What you submit to a publisher will stay the same. You can try submitting that rejected manuscript to a different editor. And sometimes, they'll accept it without you needing to revise it. But again, the secret is that they're not rejecting writers, they reject manuscripts.
As to why publishers and editors reject manuscripts, there's a lot of reasons. It's not just about profit. Sometimes, it's about target audience. Like don't expect a realist, romance manuscript to be accepted by a horror editor. I'm not saying don't submit it as the said editor might give you feedback or refer you to the appropriate editor in their publishing department but don't always assume that your manuscript will win people over by the sheer brilliance of the text. Sometimes, it's not about quality but rather the appropriate market for it.
And if it gets rejected in the market you're aiming for, well, that's what revision is for.