Some years ago, I did fanfic and had a great time polishing the writerly muscles. You're given names, setting, etc, but what adventures can you have that keeps the original identifiable as such?
I read a whole lot of crap, and a few gems, which is what got me into writing fanfic in the first place. I felt that I could do better than most and as well as the top 5%. I got on a few popular sites, had some great times with fanfic fans. Then I wanted to tell stories with similar but not exact characters. In fanfic those are called ubers: different names, different times.
I always credited the original author/company and posted on free sites. These tales were to be shared with fans, they were not for sale.
A few good fanfic writers do continue stories of popular series and characters. There are hundreds of StarTrek and Star Wars books NOT written by Gene Roddenberry (while he was alive) or by George Lucas, for two examples.
Often with known names who stop their series, the publishing companies will look for writers who can copy that style and continue the adventure of the character, the family, the sweeping saga of a nest of mice. :}
Ghost writer Andrew Neiderman is still doing Flowers In the Attic books. The original author, V.C. Andrews died in '86. Her name still goes on the books, a percentage goes to her heirs, and a bit goes to Mr. Neiderman.
All these 'well-known' books are formulaic and are based on a paradigm of any number of familiar tales that go back as far as stories themselves: Marduk vs Tiamat--god vs dragon, Gilgamesh--the flawed hero, Old Woman and Coyote the Trickster--from American Indian tales, Amaterasu--the Japanese goddess who brought light to the world, etc. The Cat in the Hat is the Trickster all over again :}
Romeo and Juliet is based on a Greek tale from 1500 years before: Pyramis and Thisbe, off from that we have West Side Story.
Boiled down, everything is 'fan fiction' done by those who love what they read. If you are willing to put in the work: change the names, add new drama, put in a new setting, and write a good story, anything can happen.