Fan fiction libraries
Today’s analogy: a fan fiction writer sets their story in a world created by someone else, and thus has the opportunity to use both characters and world/story elements that were originally created by others. Especially for novice writers, this can be a boon, as they can focus on some sub-area of fiction writing without needing to create everything from scratch. That experience will help them later understand how to create their own elements and how such elements need to fit together with everything else.
But even experienced writers might prefer to just focus on telling some particular kind of story, without needing to design the whole world and characters from the ground up. In that case, using an existing world can make things much easier. Of course, often a writer will want to tell a story which isn’t quite a perfect fit for an existing world. If that’s the case, the borrowed elements will need to be tweaked, with the creator replacing them with altered versions which inherit most of the elements’ original properties but change some things. If this would require too many changes, it can be simpler to just create an entirely new world, instead of spending a lot of effort forcing existing elements into a purpose they’re not really a good match for.
Still, there are advantages with using existing elements. If the writer doesn’t modify them, and the elements behave as others expect them to behave, the story becomes compatible with a vastly larger set of stories, all taking place in the same universe. Other stories can in turn easily build on the contributions that this story made. It also becomes easier for others to read the story, as those others will already be familiar with the expected behavior and properties of the reused elements and can take advantage of their existing knowledge.
In other words, a writer who’s writing fan fiction is like a programmer who’s using existing libraries.
(And although I’ve only spoken about fan fiction so far, obviously the real world is the biggest standard library of them all. Fanfic writers sometimes get flak for being uncreative and just playing in someone else’s world: but at the same time mainstream writers have no shame in recycling the ideas of others, such as when they brazenly use concepts like “people” and “cars” without bothering to come up with their own objects.)