What makes a story good?
For me, it ultimately comes down to the emotional stakes: are we invested in the central characters and what happens to them? Prequels tend to face some structural but not insurmountable problems in this regard, with the result that most of them suck, but they don't have to.
I agree with Snarff that a shared setting is not the same as a prequel, though there is frequently some overlap. Generally, by prequel I think of a story that is intentionally designed to come before and fit into a well known story in some way.
I'm gonna use a couple Star Wars examples to illustrate what works with a prequel, and what doesn't. 'Cause I think we can safely assume that just about everyone who posts to this forum is familiar with the material.
Good prequel: Rogue One (and even more so, Andor). With Rogue One, we knew what the upshot would be: the rebels would get the plans and use them to blow up the Death Star. Go Luke! But how they got the plans turned out to be a great story because it focused on the emotional arc of a new band of characters, contrasting their wants and needs, so that their ultimate sacrifice had meaning.
Andor is even more impressive because we go in knowing that [SPOILER ALERT] the protagonist ultimately dies and the rebellion succeeds. But, again by focusing so heavily on character growth for protagonist and antagonist alike, it is a journey well worth taking. In fact, my favourite TV series of the 2020s. By the last episode, I was so invested, I can't even tell you. It artfully exploits our knowledge of Andor's doom to emphasize the heaviness of the stakes: his journey from being mostly in it for himself to someone who will die for a cause becomes a celebration of sacrifice (c.f. Stark, Tony). It exploits a principle that the ancient Greek dramatists understood: it's not about the ending, it's about the journey.
Contrast with [sigh] Solo: A Star Wars Story. This is the worst kind of prequel. There's a facade of character growth, but nothing meaningful; nothing about this film makes Han a more interesting character. In fact, the contrary is true: the revelations about Han's past make him less mysterious and interesting, and are often cringe-inducing.
Exhibit A: How did Han get his last name? (A)Did you care? In a world in which characters are named, variously, Obi Wan Kenobi, Darth Vader, Grand Moff Tarkin, Luke Skywalker, Biggs Darklighter, Yoda, Princess Leia Organa, etc. etc. etc., did even one person in the entire world think "Han Solo? Weird name!" (B) Could that information that we never needed or wanted have been presented in a more stilted, cringe-inducing way?
Exhibit B: How did Chewbacca get his nickname, Chewie? Are we stupid? Again, was there a single person in the world who needed that explained? Maybe there was one guy sitting in a theatre who had a sudden, marvellous epiphany: "Oh, it was short for Chewbacca this whole time! How did I not see it?" My god.
I'm reminded of that Santa origin stop motion movie, Santa Claus Is Coming to Town, and the way it literally has audience voice-over of little kids gasping and saying things like, "Oh, so that's how he got his beard," and stuff. I'd like to see an edit of Solo with that added. That would be good fun.
And then there's the plot: i.e. let's make a whole movie in which the central problem is entirely based on justifying George Lucas's poor understanding of astronomical terms, and in which the main character "growth" amounts to fan service. We all know that Lucas used the term "parsec" incorrectly, and nobody cared. Did we need a whole movie devoted to retconning some throwaway dialogue so we could, what, say "AKSHUALLY Lucas was right the whole time."? Like, seriously? So dumb. And Han's big character growth is HE SHOOTS FIRST! So enlightening!
Oddly, this is an entire filmed premised around supporting Lucas's obvious writing error in the first film, and rejecting his obvious editing error in the re-releases.
The result is that there are no emotional stakes. Nothing that happens in Solo matters; we all know how it is going to come out, it offers answers to questions that nobody cared about, and could not exist without any impact on our understanding of the overall story. Contrast with Rogue One and Andor, which add resonance to the original without undermining it.
And don't get me started on the Alien franchise.