That doesn't explain how it was hugely popular when it was a fanfic. Unless you're implying her husband was marketing the fanfic?
E L James was actually a master of the at the time standard and popular format for fanfiction, mainly using teenage drama tropes mixed with harlequin romance standard tropes. This is why it's full of sudden plot twists with little to no foreshadowing and constant argument that would lead to massive amounts of reader engagement with each argument getting responses of "omg I hope they stay together" and repeat for massive amounts of comments and engagement. Then the knock on effect of constant updated pushing her to the top of frequently updated every few days, constant drama picking fights with people making others more likely to hear about it and check it out just to see what happening (as many people read the books just because they heard how bad it was) forming a feedback loop of people checking it out to see what the big deal about this super popular fanfic is.
In many ways, writing aside, it's a master class n getting your work popular if you're willing to risk all publicity is good.
Tbf most teenage romances are aimed at teens and they do think like that (looking at you, Romeo and Juilliet),