Sometimes it just doesn't make sense to start at the "beginning" of the story, because you are telling the story of an event, and if that event captures the interest of the public and does well, then it's sometimes natural not to tell what happened afterwards (especially if the event in question had a solid conclusion), but rather, to tell the story of the circumstances and happenings that led up to that event happening in the first place.
Sometimes prequels are actually written afterwards as well, for example, the book 'The Magicians Nephew', written by CS Lewis in the Narnia series, is the story of how Narnia came to be, the origins of the White Witch and Aslan etc.
Chronologically it's the first in the series, but it wouldn't make any kind of sense to have made the movie of this before making 'The Lion, The Witch and The Wardrobe', would it? Because while 'The Lion, The Witch....' isn't the first part of the story, it's still the 'entry point', so to speak, to the entire series.