Discovery fiction is a style of pedagogy in which one presents a fictitious story about how someone could have invented an idea.
However, there is another way of justifying the introduction of a new concept into mathematics. Instead of looking at the actual history of that concept, one can look at a fictitious history. If you can tell a plausible story about why a concept might have been invented, then that is sufficient to make it seem reasonable. It solves the mystery of how anyone could have thought of the concept, and it also shows that it was pretty well inevitable that the concept would have been introduced sooner or later.