As someone who writes a lot of fanfiction (Harry Potter - Draco/Hermione aka Dramione mostly, and also some Captain America - Steve/Bucky) which includes a lot of smuttiness as I am a filthy, shameless person, and as someone who hates porn, here's my two cents:
Porn is all about male gaze, male dominance, male pleasure, and it's fake and hollow.
It's a woman slathered in about 5 pounds of makeup, who is probably tired, bored, sore, and chafed from hours of awkwardly postured sex acts. The man is probably suffering similar issues.
Safe sex is absent as condoms are not used, and consent may be coerced. The woman may be (and often is,) a naive 18 year old who thinks porn will be an easy way to make heaps of cash and ends up starring in a handful of films, blowing any money she makes (often on drugs that make the reality bearable,) then slinking home and living with reality of her pornography being available to all on the internet forever after.
It also involves abhorrent genres (heard of rosebud porn? If not I'll save you the horror of googling it; it's anal prolapse pornography. It is apparently a niche, but growing genre. And it is not faked anal prolapses, it is real women with anal prolapses being anally penetrated for (male) consumers to enliven their masturbation with.
This is to be expected; apparently, it is quite common for those who watch porn regularly to become desensitised to the content they watch over time, and need to escalate the taboo nature and extremity of what they watch. Hence, a large percentage of boys who begin watching vanilla clips on the internet at age 12, will be watching brutal incest rape porn or some such by the time they're adults. And worse, it will seem normal to them.
Even vanilla porn objectifies women, presents an entirely unrealistic view of sex that does negatively impact young women's (and men's) sexual explorations, and promotes the abuse and injury of women even in the more vanilla genres as a normal matter of course during sex.
Whereas erotic fanfiction is about female gaze, female dominance (in terms of being the author,) and female pleasure. Being a written medium, one is aware of characters' feelings, desires, and whether or not consent is there. It also does not involve any actual humans being used to portray the fantasy. Even if it is 'problematic' (ugh I hate that word now,) it is clearly fiction.
It does indeed explore rape themes a lot (as well as other taboo types of sex.) I think this is because rape, sexual assault, and coercion are (sadly) normal parts of the female experience when it comes to sex. Society, media, and our own experiences prime us to see that as normal, if not 'okay', and I think in a lot of fanfiction you'll see (often young) female writers struggling with that fact.
We're trying to find our own sexuality, and what that even is, and if that even exists, in a world where young men talk about sex in terms like "I'd hit that," "I want to destroy her pussy," and "I'd wreck her cunt."
It is also commonly explored as part of a cathartic outpouring/exorcism for a writer who has suffered it herself. And often it is simply an easy trope for inserting emotional turmoil into the story, to give the characters (and reader,) something really terrible to agonise over.
Two of my own Harry Potter fics involve themes of sexual assault. In one, it is the male character who is raped by another man - I wanted to turn around that trope of the female character being the one to suffer the trauma, and I also shamelessly wanted to inject a great amount of emotional torment. In the other, I was attempting to write a realistic, non-gross version of a common Draco/Hermione fic trope.
But then I don't write the rape as erotica; for myself, I began writing erotic fanfiction because I noticed the reams of innaccuracies regarding sex that young writers had in fanfiction, that other young people were reading. And so I wanted to present realistic sex, that didn't involve tearing hymens, orgasms from vaginal penetration, and that had varied types of sex - from sleepy mediocre sex, to angry sex, to the very tender sort.
I think writers who write the rape itself as erotica do so in great part because that is the underlying, subconscious dynamic that society presents to women, regarding sex. It's not ideal, imo, but still better than live action pornography because no one is actually being harmed.
(Shite, I am so not concise, sorry! Congrats to anyone who read through all that ramble!)